void loop( ) // loop function that executes repeatedly
{
if(Serial.available( ) > 0) // It will only send data when the received data is greater than 0.
{
arrivingdatabyte = Serial.read( ); // It will read the incoming or arriving data byte
Serial.print("data byte received:");
Serial.println(arrivingdatabyte, DEC); // here, DEC means Decimal
}
}
I'd suggest to remove the while and the true/false in your code, and change it according to the sample code.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Your Adruino code looks complicated, and I'm not sure if it's correct, or if you're overwriting the variable IncomingString in the while loop.
The sample code for serial input from https://www.javatpoint.com/arduino-serial-available:
I'd suggest to remove the while and the true/false in your code, and change it according to the sample code.