Skip to content

Instantly share code, notes, and snippets.

@XiaohanYa
Created March 3, 2017 02:26
Show Gist options
  • Save XiaohanYa/f76e33911c2e0cf5b04b5371a0110554 to your computer and use it in GitHub Desktop.
Save XiaohanYa/f76e33911c2e0cf5b04b5371a0110554 to your computer and use it in GitHub Desktop.
InteractionLab
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