Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleExample "Hello WorldCall response"
collapsetrue
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);
    }
  } 
}

...