 # Serial monitor

hi

I was wondering. how do you actually send a number with the serial monitor? if you send 0 it will actually send 48. any ideas

Roy

48 (0x30) is the ASCII code for the digit zero, and by happy coincidence 49 (0x31) is the ASCII code for the digit one. 65 (0x41) is the ASCII code for the letter 'A' What do you want to do?

Hi precious roy,

48 is the ASCII decimal value for the character 0. Although i don't have any experience on this subject i think you can do something like valueYouWant = recievedValue - "0"; I know for sure that you received the ASCII value but the 'solution' you have to dubbel-check.

Jeroen

i mean... how does the arduino know that you entered "100" when he receives it in 3 times? like

49 48 48

how do you translate it back to 100

Sorry that i can't give you a clear answer but http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1231650517 is a thread that discusses the issue.

Jeroen

how does the arduino know that you entered “100” when he receives it in 3 times?

## 49 - 48 = 1 * 102 = 100 48 - 48 = 0 * 101 = 0 48 - 48 = 0 * 100 = 0

100

sorry bad at math but what does the 48 stand for? is that where the numbers start?

48 stands for the ASCII digit zero '0' 48 + 9 = 57 stands for the ASCII digit nine '9' (or, simpler in hex 0x30 is zero '0, 0x39 is nine '9')

(not maths, but arithmetic)

sorry bad at math but what does the 48 stand for? is that where the numbers start?

Does this link help? ==> http://www.arduino.cc/en/Reference/ASCIIchart

Look for the ‘0’ in the ‘Character’ column of that table.

that might. thanks :}