The Microbit_Uart_Simple sensor provides the ability to read from and write strings to the BBC micro:bit’s serial UART port.
SendMessage – Writes the given value UART_TX to the micro:bit. The size of the message will
depend on the value of UART_TX. Numbers will be converted to integers and sent
as 32-bit integer values. Strings will be encoded using UTF-8. Lists of objects will be
sent as a sequence of bytes using the aforementioned rules for numbers and strings.
Parameters:
UART_TX (any) —
The value to transmit to the RX “pin” of the micro:bit. Strings will be encoded as UTF-8,
numbers will be sent as 32-bit integers. Lists of values will be converted into be
converted into a sequence of bytes depending on the type of each value in the list.MessageReceived – The TXCharacteristicReceived event is run whenever messages are received over the
micro:bit’s serial UART protocol.
Parameters:
message (list) —
A list of unsigned byte values read from the device.MessageSent – The WroteRXCharacteristic event is run after a message is written to the micro:bit
via its serial UART.
Parameters:
UART_TX_FIELD (list) —
A list of unsigned byte values written to the device.