I have a basic problem with my Arduino Uno.
My example code gets a number over Serial port and should print it back.
int incomingByte = 0;
void setup() {
Serial.begin(9600);
Serial.println("Hello World");
}
void loop() {
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}
When I send 0, I receive 48.
0->48
1->49
2->50
3->51
a->97
b->98
A->65
So why doesn't it send the same numbers back to me?