Serial communication with host PC for raspberry pico #9493
-
Hello all, I am using a Raspberry Pico and programming it using Thonny. I would now like to talk to the Pico using a host PC(Pico is connected to the host via USB cable) and send data serially back and forth between the Pico & the host. Is there a reliable way to do this? I checked micropython library and it states that the class USB_VCP can be used for serial comm but only for PyBoard and not the Pico. Is there any similar way to do this for the Pico? Thank you for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The easiest way to do this is just with regular Python The other option is to use https://docs.micropython.org/en/latest/reference/pyboard.py.html#using-the-pyboard-library to remote control the device. Or take a look at https://github.com/BrianPugh/belay for a more comprehensive solution. The USB_VCP on STM32 allows you to use the VCP independent of stdin/stdout. This is not currently possible on rp2 / Pico. |
Beta Was this translation helpful? Give feedback.
The easiest way to do this is just with regular Python
print()
andinput()
. If you want to do something more sophisticated (i.e. non-blocking input) then you can usesys.stdin
directly.The other option is to use https://docs.micropython.org/en/latest/reference/pyboard.py.html#using-the-pyboard-library to remote control the device. Or take a look at https://github.com/BrianPugh/belay for a more comprehensive solution.
The USB_VCP on STM32 allows you to use the VCP independent of stdin/stdout. This is not currently possible on rp2 / Pico.