Created
August 17, 2010 04:07
-
-
Save mattwilliamson/528417 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ledPin = 13; | |
boolean ledOn = false; | |
void setup() { | |
pinMode(ledPin, OUTPUT); // Set servo pin as an output pin | |
Serial.begin(9600); | |
//Serial.println("Arduino serial"); | |
} | |
void loop() { | |
if (Serial.available() > 0) { | |
int message = Serial.read(); | |
if (message == 49) { digitalWrite(ledPin, HIGH); } | |
if (message == 48) { digitalWrite(ledPin, LOW); } | |
// print pulseWidth back to the Serial Monitor (uncomment to debug) | |
// Serial.print("Pulse Width: "); | |
// Serial.print(pulseWidth); | |
// Serial.println("us"); // microseconds | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment