#include <SERIAL.bas> ' source in /Program Files/Coridium/BASIClib
FUNCTION SERIN (pin, baud, posTrue, INcnt, BYREF INlist as string)
If INcnt is 0, then the string will be filled with bytes until a 0, CR or LF character is received. Note that no bounds checking is performed on the input, and if a 0, CR, or LF is never received then this routine will hang. As there is no bounds checking its possible to overwrite other variables, if less than 256 bytes have been allocated for the InputList string.
SERIN will timeout after 0.5 seconds and return -1 and place 255 in the next item in the INlist before the timeout. These routines are "bit-banged" by the processor, so the processor is consumed during these operations. Interrupts are also disabled during each byte for these operations. The hardware UART0 can be used see RXD0 or DEBUGIN . The timeout can be changed with SERINtimeout.
Baudrates can be up to 115.2 Kbaud for all pins on transmit. Receive rates to 57Kb