Hi everyone,
Is second parameter in begin() function supported or not? On official site it says it is supported and the syntax is:
Serial.begin(speed, config);
with 'config' being one of the predefined values, like SERIAL_5E1 or SERIAL_7E1.
The problem is, that as soon as I add the SERIAL_7E1 as second parameter, the compiler gives me error:
'SERIAL_7E1' was not declared in this scope.
The sketch compiles OK with just one parameter.
Here is how I code it:
Serial.begin (9600, SERIAL_7E1);
Do I need to add #include ? If yes - what's the name of library?
The selected board is Arduino Mega 2560.
Thanks in advance.
system
April 20, 2013, 7:36am
2
You con't have to include something.
But you should use the latest Arduino software.
system
April 20, 2013, 7:47am
3
Just confirm in a blank sketch that this won't compile:
void setup(){
Serial.begin(9600,SERIAL_7E1);
}
void loop(){}
It compiles for me using IDE 1.0.4
It compiled for me, too, using IDE 1.0.4.
How to use this forum
system
April 20, 2013, 6:26pm
7
Sorry, yes I probably should have phrased that better, what I wrote should definitely work, but should be a quick test of what the OP said was wrong
Thanks for all the replays. The problem was old version of IDE. I'm using Linux Mint and the version in Software Manager was not updated.
I downloaded v. 1.0.4 and it compiles OK.