Created
March 3, 2017 02:26
-
-
Save XiaohanYa/f76e33911c2e0cf5b04b5371a0110554 to your computer and use it in GitHub Desktop.
InteractionLab
This file contains 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 valueFromProcessing; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(13, OUTPUT); | |
} | |
void loop() { | |
//Serial.write(100);//serial.write number refers to code while serial print number is number | |
//int value=100; | |
// Serial.write(value); | |
Serial.println(100); | |
while (Serial.available()) { | |
valueFromProcessing = Serial.read(); | |
} | |
if (valueFromProcessing == 'H') { | |
digitalWrite(13, HIGH); | |
} else { | |
digitalWrite(13, LOW); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment