Skip to content

UART — send data (uart_write)

What it does: Sends the specified buffer/string through the initialized UART port.

uart_write

Inputs

  • buffer: data to send (text or bytes).

Output

  • None (statement block).

When to use it

  • For sending commands to modules or other microcontroller.
  • For confirmation messages and serial line telemetry.

Tips and pitfalls

  • If the target device expects a line break, add it manually (eg "\n").
  • For binary protocols, send bytes, not text.

Generated Python example

uart1.write("LED_ON\n")