Package comm
Class UART

Public Method open

boolean open(int baud, int parity, int bits, int stop)

Throws:

_INSERT_METHOD_SIGNATURE_HERE_

Description:

Parameter Value Description
baud UART.baud_300
UART.baud_600
UART.baud_1200
UART.baud_2400
UART.baud_4800
UART.baud_9600
UART.baud_19200
UART.baud_38400
UART.baud_57600
UART.baud_115200
UART.baud_230400
UART.baud_460800
baud rate of the UART port
parity UART.PAR_NONE
UART.PAR_ODD
UART.PAR_EVEN
UART.PAR_FORCE1
UART.PAR_FORCE0
parity check
bits UART.BITS_5
UART.BITS_6
UART.BITS_7
UART.BITS_8
number of data bits
stop UART.STOP_1
UART.STOP_2
number of stop bits

The UART communication parameter can be adjusted with the open(int, int, int, int) method once an instance of the UART class is created. All parameters for the UART communication are listed in the table above.


Returns Range Description
opened true ... false whether the UART port can be opened or not

The open() method returns true when the UART port can be opened.

Example

The following example opens the UART port.

   if (uart.open(UART.baud_115200,UART.STOP_1,UART.BITS_8,UART.PAR_NONE))
      Draw.writeText("the serial port is open");

See also:

SPI
I2C