Pages: [1]   Go Down
Author Topic: serial communication question  (Read 266 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 171
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: