Nabu (TX) -> (RX) RS232-TTL adapter (TX) -> (RX) Pico UART1 @ 111875 -> [ CircuitPython ] -> Pico UART2 @ 115200 (TX) -> (RX) TTL-RS232 adapter 9-pin -> VT510
Code: Select all
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
# SPDX-License-Identifier: MIT
import board
import busio
uart1 = busio.UART(tx=board.A2, rx=board.A3, baudrate=111875)
uart2 = busio.UART(tx=board.D24, rx=board.D25, baudrate=115200)
while True:
nabu = uart1.read(1)
vt510 = uart2.read(1)
if vt510:
print("From VT510: {}".format(vt510))
elif nabu:
print("From NABU: {}".format(nabu))
uart2.write(str(nabu).encode("ISO-8859-1"))
Code: Select all
main.py output:
From VT510: b'\x00'
From NABU: b'\x12'
From NABU: b'\x00'
From NABU: b'\x12'
From NABU: b'\x00'
From NABU: b'\x12'
From NABU: b'\x00'
From NABU: b'\x12'
From NABU: b'\x00'
From VT510: b'\r'
From VT510: b'y'
From VT510: b'g'