The ARC Script Manual.

U.)

UARTAvailable( boardIndex, port ) Receive the count of bytes available in the Peripheral UART Receive Buffer of the EZ-B v4. The UART receive buffers on the EZ-B v4 are 5,000 bytes. The Board Index is the EZ-B index starting at 0. The port can be 0, 1 or 2. Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port. Example: UARTAvailable(0, 0)

UARTInit( boardIndex, port, baudRate ) Initialize the Peripheral UART on the EZ-B v4 with the specified baud rate. The UART will stay initialized until the EZ-B v4 is power cycled, and therefore this command only needs to be called once. The Board Index is the EZ-B index starting at 0. The port can be 0, 1 or 2. The baud rate can be between 1 and 3750000 bps. The UART receive buffers on the EZ-B v4 are 5,000 bytes. Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port. Example: UARTInit(0, 0, 9600 )

UARTRead( boardIndex, port, numBytes ) Receive ASCII bytes from the Peripheral UART Receive Buffer of the EZ-B v4. The UART receive buffers on the EZ-B v4 are 5,000 bytes. To know how many bytes are available, use the UARTAvailable() function. The Board Index is the EZ-B index starting at 0. The port can be 0, 1 or 2. Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port. Example: UARTRead(0, 0, 10) Example: UARTRead(0, 0, UARTAvailable(0, 1))

UARTReadAvailable( boardIndex, port ) Receive all available ASCII bytes from the Peripheral UART Receive Buffer of the EZ-B v4. The UART receive buffers on the EZ-B v4 are 5,000 bytes. The Board Index is the EZ-B index starting at 0. The port can be 0, 1 or 2. Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port. Example: UARTReadAvailable(0, 0) Example: UARTReadAvailable(0, 0)

UARTReadBinary( boardIndex, port, numBytes, variable ) Receive binary bytes from the Peripheral UART Receive Buffer of the EZ-B v4 into the variable as an array. The UART receive buffers on the EZ-B v4 are 5,000 bytes. To know how many bytes are available, use the UARTAvailable() function. The Board Index is the EZ-B index starting at 0. The port can be 0, 1 or 2. Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port. Example: UARTReadBinary(0, 0, 10, $variable) Example: UARTReadBinary(0, 0, UARTAvailable(0, 1), $variable)

UARTWrite( boardIndex, port, data ) Write ASCII data through the Peripheral UART. The Board Index is the EZ-B index starting at 0. The port can be 0, 1 or 2. Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port. Example: UARTWrite(0, 0, hello world ) Example: UARTWrite(0, 0, 0x30, 0x40, hello )

UARTWriteBinary( boardIndex, port, variable ) Write binary variable array data through the Peripheral UART. The Board Index is the EZ-B index starting at 0. The port can be 0, 1 or 2. Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port. Example: UARTWriteBinary(0, 0, $variable )

References

UART Ports The UARTx ports are used connect to Serial TTL devices for both input and output. Contrary to the digital port Serial Output, these peripherals will also receive data into an input buffer as well. The input buffer of each UART is 5,000 Bytes. There are 3 UARTs, the first is the hardware labelled port, second and third are digital pins. These UARTs are controlled using the UARTInit(), UARTWrite(), UARTRead() and UARTAvailable() commands. The speed of these UARTs can be any integer between 1 and 3750000 bps. UART0 TX: Expansion Connector UART0 RX: Expansion Connector UART1 TX: D5 UART1 RX: D6 UART2 TX: D18 UART2 RX: D19


ARC Pro

Upgrade to ARC Pro

Don't limit your robot's potential – subscribe to ARC Pro and transform it into a dynamic, intelligent machine.