...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
String inData; void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); } void loop() { while (Serial.available() > 0) { char recieved = Serial.read(); inData += recieved; // Process message when new line character is recieved if (recieved == '\n') { Serial.print("I got : "); Serial.println(inData); inData = ""; // Clear recieved buffer delay(1000); } } } |
...