Go Down

Topic: Multiple byte serial input (Read 914 times) previous topic - next topic


I have been scrounging the web for a way to send multiple bytes from my PC to my arduino. I need to be able to send a number( number of sensor counts) ranging from 1 to 1,000, or maybe more. I need this data to be usable as if I had said:

volatile int Dists = 65;

on the arduino
(It is volatile because it needs to be used in an interrupt)

Please Help!


What program will be doing the sending?

Its easiest to convert the numbers to binary and put a 'marker' between numbers.
For between 1 to 1,000 I'd use a short (two bytes) followed by a null (0x00).

That way its easy for the Arduino to use (one bitshift will combine the two bytes back in to a short in the Arduino) and the protocol is simple.


I must be able to send data to it from a serial terminal, so it must be something I can type on a standard keyboard. I know binary pretty well, so I could handle that, but I still don't know how to implement it.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131