Connect raspberry pi pico (micropython with thonny) to python 3 on windows 10

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
yamcha
Posts: 2
Joined: Thu Feb 25, 2021 3:53 am

Connect raspberry pi pico (micropython with thonny) to python 3 on windows 10

Post by yamcha » Thu Feb 25, 2021 4:11 am

Hi, I'm new and I wanted to know if the micropython can be connected with python 3 for windows 10.
I want to make a circuit that has buttons on the raspberry pi pico and when I press a physical button, in windows 10 a program is executed.
Can you add pip modules in micropython?
Excuse the ignorance.
Thanks.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Connect raspberry pi pico (micropython with thonny) to python 3 on windows 10

Post by jimmo » Thu Feb 25, 2021 6:20 am

yamcha wrote:
Thu Feb 25, 2021 4:11 am
I want to make a circuit that has buttons on the raspberry pi pico and when I press a physical button, in windows 10 a program is executed.
The easiest way to do this is to have the Pico send messages (using print() ) which a program on your PC reads.

On a PC, you can connect to the serial port from Python using the "pyserial" module.

You can also use the pyboard.py module (see http://docs.micropython.org/en/latest/r ... rd-library) to automate this. i..e you could have a get_button() method that blocks until a button is pressed, and then returns the button number. Then your PC code would call pyb.exec('get_button()') to get the next button event.
yamcha wrote:
Thu Feb 25, 2021 4:11 am
Can you add pip modules in micropython?
Sort of, but it's mostly useful for boards that have WiFi. On the Pico it is easier to just copy the files from whatever library you're using.

yamcha
Posts: 2
Joined: Thu Feb 25, 2021 3:53 am

Re: Connect raspberry pi pico (micropython with thonny) to python 3 on windows 10

Post by yamcha » Thu Feb 25, 2021 6:03 pm

Thank you Jimmo for removing that question I had, now I'm going to learn. :D

Post Reply