RXD(x)
 
Syntax

FUNCTION RXD(channel) as INTEGER
Description


RXD(x) will return 0-255 if there was serial data present. or -1 (&HFFFFFFFF) if there is no serial character available from SIN.  The hardware UARTx is used, so the CPU is not tied up, and bytes are buffered up to 256 bytes being received by an interrupt routine

SuperPRO or PROplus--

These devices support 4 UARTs, pin assignments in the Hardware Info

BASICchip or ARMmite--

Pin labeled RXD0 on the schematic, UART0 of the LPC2103.  Data is always positive true.

Baudrates can be up to 115.2 Kbaud.  

Example

BAUD(2)=9600     ' enable UART2 -- not all boards have UART2
 

' Wait for serial input on pin UART2
DO
    MyByte = RXD(2)
UNTIL MyByte >= 0

 

Differences from other BASICs

See also