surepic:
This way I am converting int to ascii if its between 0-9 ascii number.Serial.write((char)id+48);
but is there easy way to deal with int whose value is >128?
lets say if int id=200.
Serial.print is not working in my case. I need serial.write.
Also tried using modulo in for loop its working but may be shorter way is possible.
thanks.
this is your original request and I have gone thru this thread and I'm lost!
I would like to understand this:
"lets say if int id=200."
If you were to use serial.write to print it to serial monitor u'd get some weird character... that not what you want, right?
what you want to achieve is to somehow use serial.write to achieve what serial.print(200,DEC) can do, right?
FYI to do that the arduino would spit out 4 bytes as ASCII '2' (0x32), '0' (0x30), '0' (0x30) and '\0' (0x00).
Am I correct to understand that all that you want the arduino to spit out is the first 3 bytes?