Pages: [1]   Go Down
Author Topic: Serial.begin(int speed) is not an int  (Read 333 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 1
Posts: 170
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Serial.begin(int speed) http://arduino.cc/en/Serial/Begin says
Quote
use one of these rates: 300, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, or 115200

Data type int http://arduino.cc/en/Reference/Int says
Quote
This yields a range of -32,768 to 32,767

So the speeds of 38400, 57600, and 115200 don't fit.  The first two will if it's an unsigned int, but even then the 115200 won't.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16517
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But in wiring.serial library baud is a long variable. A long is big enough to hold any of the possible baud rate values.

void beginSerial(long baud)


Lefty
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 170
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I figured as much.  If it didn't work, someone would have objected long before now.  I just mention it so someone can update the web page.
Logged

Pages: [1]   Go Up
Jump to: