Last active
August 29, 2015 13:59
-
-
Save xseignard/10891910 to your computer and use it in GitHub Desktop.
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
String fromProcessing; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(13, OUTPUT); | |
} | |
void loop() { | |
while (Serial.available() > 0) { | |
char recieved = Serial.read(); | |
// si le caractère recu est le caractère de stop | |
if (recieved == '#') { | |
Serial.print(fromProcessing); | |
if(fromProcessing == "hello world") { | |
digitalWrite(13, HIGH); | |
} | |
else { | |
digitalWrite(13, LOW); | |
} | |
fromProcessing = ""; | |
} | |
else { | |
fromProcessing += recieved; | |
} | |
} | |
} |
Author
xseignard
commented
Apr 16, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment