6 years, 6 months ago.

How to Set the Parity of a serial object?

I need a way to be able to call the Serial.format() function. However I can't seem to find the syntax that works with the parity.

I have the following:

Parity parity = SerialBase::None; uart.format(8, parity, 1);

When I try to compile, I get Parity is undefined.

1 Answer

6 years, 6 months ago.

Hello,

Try either

    SerialBase::Parity  parity = SerialBase::None;
    uart.format(8, parity, 1);

or simply

    uart.format(8, SerialBase::None, 1);

Accepted Answer