Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8609

MicroPython • Re: Convert pyboard code to RP2040 USB_VCP

$
0
0
With that said, isn't the REPL just a virtual com port anyways?
Yes. Here's how I read input a character at a time -

Code:

import micropythonimport selectimport sysmicropython.kbd_intr(-1)while True:  while sys.stdin in select.select([sys.stdin], [], [], 0)[0]:    ch = sys.stdin.read(1)    print("Got 0x{:02X}".format(ord(ch)))

Statistics: Posted by hippy — Mon Jun 23, 2025 11:30 am



Viewing all articles
Browse latest Browse all 8609

Trending Articles