Pages: [1]   Go Down
Author Topic: Serial port settings  (Read 322 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How do I set the parity and data size size options on the seial ports. I am using a Mega 2560 board.
All I can see is how to set the baud rate.

Also can I set I/O ports in one go rather than on a bit at a time basis provided by the  pinMode digitalRead digitalWrite comand strings?

Thanks in advance
Logged

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

How do I set the parity and data size size options on the seial ports. I am using a Mega 2560 board.
All I can see is how to set the baud rate.

Also can I set I/O ports in one go rather than on a bit at a time basis provided by the  pinMode digitalRead digitalWrite comand strings?

Thanks in advance

They optional second argument given to the serial.begin() statement will handle your needs. See:

http://arduino.cc/en/Serial/Begin

Lefty
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25752
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@clayender: There's a couple of sticky threads at the top of this section - please read them.

Hijacked thread with duplicate question tidied.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for that I guess I should have looked in the reference section ore carefully.

However I have checked through it looking for ways to write and read byte wide data to the ports and can't find anything there????
Logged

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

Quote
However I have checked through it looking for ways to write and read byte wide data to the ports and can't find anything there????
Serial.write() writes byte sized values, and Serial.read() reads byte sized values. They are among the most commonly used Serial methods.
Logged

Pages: [1]   Go Up
Jump to: