Go Down

Topic: Serial port settings (Read 384 times) previous topic - next topic

clayender

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

retrolefty


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

AWOL

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

Hijacked thread with duplicate question tidied.
"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.

clayender

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????

PaulS

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.

Go Up