arduino:serial_communication
Differences
This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
arduino:serial_communication [2012/09/14 00:51] – created mithat | arduino:serial_communication [2012/09/14 01:02] – mithat | ||
---|---|---|---|
Line 12: | Line 12: | ||
void setup() { | void setup() { | ||
Serial.begin(9600); | Serial.begin(9600); | ||
+ | |||
pinMode(pushButtonPin, | pinMode(pushButtonPin, | ||
digitalWrite(pushButtonPin, | digitalWrite(pushButtonPin, | ||
+ | |||
pinMode(ledPin, | pinMode(ledPin, | ||
} | } | ||
Line 21: | Line 23: | ||
// set LED state accordingly | // set LED state accordingly | ||
- | if (buttonState == HIGH) // if the button is pushed | + | if (buttonState == LOW) // if the button is pushed |
digitalWrite(ledPin, | digitalWrite(ledPin, | ||
else // otherwise | else // otherwise |
arduino/serial_communication.txt · Last modified: 2012/09/14 01:19 by mithat