Serial port settings

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

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

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

Lefty

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

Hijacked thread with duplicate question tidied.

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

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.