I have this code.
String incoming; // for incoming serial data
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop() {
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incoming = Serial.read();
String mysrr = String(incoming);
// say what you got:
Serial.print("I received: ");
Serial.println(mysrr);
}
}
A few of you will recognise this as an Arduino example.
However, when I run it ( I sent it the message "hi"), I get this in the serial:
I received: 104
I received: 105
Why is this happening?