views:

109

answers:

1

hi fellows, i want to send integers to arduino via serial. for example when i send "1" the data received by arduino is "49" and when i send "a" the data received by arduino is "97"

there were two functions in python; ord() and unichr() for example unichr(97) = u"a" and ord(u"a")=97

but im not that good at C language.

A: 

alphanumeric to integer function: http://en.wikipedia.org/wiki/Atoi

you may also find http://www.cplusplus.com/reference/clibrary/cstdlib/ useful. Although it says C++, this particular section is C library. notice that you can use C++ with arduino.

aaa