Go Down

Topic: serial communication question (Read 351 times) previous topic - next topic

permnoob

this is the easiest question you will answer today, i promise.  I would jsut test it myself buuuut I may have made my arduino a biiiiit not worky worky.

if I try to write the value 400 to the serial port, what comes out the port? say for example

Serial.print(400);
or
Serial.write(400);

I know it compiles, but that is about it.

PaulS

Serial.print(400) will send '4', '0', '0' to the serial port.

Serial.write(400) will send 144 to the serial port - the write() function takes a byte, so only the low order byte (containing 144) is sent. The high order byte is ignored.

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!

Arduino
via Egeo 16
Torino, 10131
Italy