Console
The console module enables serial data to be read and written over the RS232 to USB interface. The hardware UART is connected to pins D0 and D1. Please note that if the Firewing loader firmware is not being used, you will need to configure the RX and TX pins manually as described here for the module to work correctly.
SetBaudrate
Sub SetBaudrate(baud As Baudrate)- baud - The communication baudrate. Can be Baudrate.Is9600, Baudrate.Is19200, Baudrate.Is38400 and Baudrate.Is115200. Default value if Baudrate.Is38400.
Sets the communication baudrate for the UART port. Please note that if using the Firewing main board, the baudrate is fixed at Baudrate.Is38400.
Read
compound sub Read(byref item)
- item - Data to read. Can by a string or byte variable.
Read multiple items from the hardware UART. For example:
dim myString as string Console.Read(myString)
See also ReadTerminator.
ReadByte
Function ReadByte() As Byte
Reada single byte from the hardware Uart. For example:
dim valA as byte = Console.ReadByte() dim valB as byte = Console.ReadByte()
Write
compound sub Write(item)
- item - Data to write. Can be a string or byte data.
Write multiple items to the hardware UART. For example:
' write some text followed by CR and LF character Console.Write("Hello World",13,10)
WriteByte
sub WriteByte(data as byte)
- item - Data to write. Can be a single byte only.
Write a single byte to the hardware Uart. For example:
Console.WriteByte(13) Console.WriteByte(10)
ReadTerminator
Public ReadTerminator As Byte
Set the read terminator character. By default, it is set to Nothing (0 or null).