/* Serial Communication with Digital Output Sooyong Lee 2011/02/28 */ void setup() { Serial.begin(9600); pinMode(13, OUTPUT); Serial.println("type 1 and click Send button to turn on the LED"); Serial.println("type 0 and click Send button to turn off the LED"); } void loop() { if (Serial.available() > 0) { int inByte = Serial.read(); switch (inByte) { case '1': digitalWrite(13, HIGH); Serial.println("LED ON"); break; case '0': digitalWrite(13, LOW); Serial.println("LED OFF"); break; } } }