hardwareUartWrite

UART.hardwareUartWrite(uartIndex, byte/byteArray, [ezbIndex])

Parameters

uartIndex Index of UART to write to.
byte/byteArray Byte or byte array to write to the UART.
ezbIndex (optional) Board index of the EZB to use.

Returns

Nothing

Description

Writes byte to the specified UART. A byte array can instead be provided to write to the specified UART. The UART must be initialized first.

Example

// Initialize the first uart (#0) to 9600 baud
UART.initHardwareUart(0, 9600);

// Write the array of bytes to the first UART
UART.hardwareUartWrite(0, [0xff, 0xf0, 0x30]);

// Initialize the first uart (#0) to 9600 baud
UART.initHardwareUart(0, 9600);

// Write a single byte to the first UART
UART.hardwareUartWrite(0, 0xff);


var str = [0xff, 0xfe, 0xfa, 0x35, 0xaf];

// write the amount of data we're gonna send
UART.hardwareUartWrite(0, str.length);

// now send the data
UART.hardwareUartWrite(0, str);