For the other Pico W / Pico WH owners out there: to get the blinking LED to work you need to swap out 25 on line 4 for 'LED'. So from: led = Pin(25, Pin.OUT) to: led = Pin('LED', Pin.OUT)
This is by far the best introductory video for the Pico I've seen on RUclips. Very easy to follow, and everything worked fine. Thank you very much for getting me off the ground with it. Would love to see more in a similar vein. Pressing the subscribe button now!
Both your REPL guide and this one have been extremely easy to follow and a bit of a life saver. I was getting in a bit of a muddle from the setup pdf from the pi foundation on how to set up the pi, setting up cmake and all sorts of other things for vscode etc etc. Why they didn't just have a simple "Use Thonny in this simple way" is a bit beyond me but there you go
Thanks buddy! I´ve just received my first pair of RP Picos, and have´nt had much luck communicating with the board, till I watched this video. We´re blinkin´!!! ;)
this is the best explanation of Pico and thonny, all other videos just assume that you know how to use thonny although they title their videos : for Absolute Beginners !!! (which is my case. :) ) ... thanks a lot !!! . hope you can show us a step by step video of building and programming a simple pico robot
Complete novice here. So let's say the pico is powered from a power supply instead of a computer. And then at 6:06 pico loses power which can easily happen. And then power comes back on. Should the code autostart or does it need to be connected to a computer again and with thonny stop/restart code and ctrl+D ?
If you save the name of your code onto the Pico as main.py then it will automatically run when power is connected, otherwise you will need to reconnect to Thonny and restart the code.
I downloaded thonny on my ubuntu couldn't see pico option in there.. had to download it on windows to work with it.. It would be a lot of help if you could make a video for ubuntu users as well.. Great video BTW i enjoyed it very much
Blink LED code for Raspberry Pi Pico W: import machine import time led = machine.Pin('LED', machine.Pin.OUT) while (True): led.on() time.sleep(.2) led.off() time.sleep(.2)
I have had trouble in finding code you run on strip leds running pi pico any help please internal code led worked fine. I keep error example code 1 from raspberry pi pi pico libaray line no name pixel? Any help anyone.
hello, enjoying your videos but struggling to get anything to work on my pico. my project isnt compicated. just need a couple of outputs triggers when given an input. basic switches etc. cant seem to get any coding to work.
I am a bit confused because i have done every step as described but the led doesn't do anything. The printed part is updating all the time when i run the program but the led not. What may be the problem?
Hey sorry for the late reply, if you are using a Pico W, they have changed how you reference the LED pin. It used to be pin 25 (but now that is used by the Wi-Fi chip), so you will need to change 25 with "LED", so that line will look like: led = Pin("LED", Pin.OUT) We have update our writte guide, and Ill Pin dnywh's comment who answers this so that other can find it more easily!
This example of printing was just a demo, but print commands are incredibly helpful for debugging. If you have code that makes a series of decisions, you can put print statements in those decisions and see how it is "thinking". You might also want to double check that you are converting numbers correctly (maybe your sensor reads in Celsius and you need to convert to Fahrenheit), so your might print it out to double check that the Pico is calculating it correctly.
Hi, great video! May I ask you a question? I have a pico W but I can't get REPL to work! Thonny keeps telling me that the device is busy, i tried soft rebooting, pressing ctrl+d, ctrl+c, tried connecting pin 30 or RUN to ground for a soft reboot, but nothing, even tried deleting code.py from the pi. I am running Circuit Python 8.1, i don't know if it is my pi the problem, please do you have any suggestion?
Nice video, I am wondering, instead of using sleep, is there a way to flash the LED while a code is running on the PICO, like to run the flash led parallel to another program that's running. I don't know if it have to run in a different thread or how this would be approached.
Hi, I'm more of a C/C++ type of person. Is there anyway i can use the Plotter and the Shell in Thonny as an output for my C codes on the pico ?? I've written a code in C to output data for proximity sensor but minicom, putty and the arduino console can't detect uart output.
suppose if i close thonny then LED will stop working.in arduino if we close arduino IDE still project runs on board.likewise how it can be happen in pico?
hi, I am dragging and dropping uf2 file onto rp2 drive, it dispears but I can't find micro python from drop down in Thornny in Interpretor drop down in options. can you help?
The best way to get technical help for any of our content is on the forums: forum.core-electronics.com.au/ We're full-time makers and are on the forums every working day!
every thing is working fine , Program is getting executed by "Run" option, but there is no "download" option to burn the micropython program in the flash memory. When I am removing USB Plug from laptop blinking of LED stopped because it is not getting power through USB it is Ok, but when I am reconnecting USB with 3 second pressing of USB and port is also showing connected , then also LED is not blinking, unless I again "run" the program, that means program is not getting burnt in flash memory , How it can be done (this type of problem is not there with Arduino board)
One quick question how do I change the Port setting in Thonny, Thonny thinks my pico is at port 13 and my computer thinks the pico is at port 14. I have to edit the configuration.ini file, Port = setting but it keeps reverting back to Port = 13
Hey, we have a community forum with lots of maker eyes that can help, feel free to chuck a post on there with some information about your code, wiring, etc. forum.core-electronics.com.au/
I'm on a mac. No go with your instructions. At this point the ESP32 seemed easier to get going. It's like there is a step missing I'm not seeing from the RPI documentation or your video to get going.
I ... actually did not know that about the plotter thing... huh... does that only work if you do the { } stuff for the print statement? Aka, can I just use simple concatenation instead of { } ? (It's not a problem, I can start using { } , but my brain just default's to concatenation XD )
It works for regular printed messages. (Regular in the sense that the format is unchanging). Just make sure to only print one message per loop. Thonny will detect the format and put in the plot labels automatically. So, yes, it will work for concatenated prints too!
Downloaded Thonny and get a Site Certificate Expired error. Even after manually installing MicroPython 1.18 onto the Pico. Been trying to fix this error for 2 days now.
can anyone help me with the pico. It keeps rebooting everytime i try to install micropython in it. also even i do not press the bootsel button it still opens as a removable drive
Made it as far as 'from machine import pin' . 'No module named machine. Looked at 'manage packages' No machine there either. Tried pip and pip3 with the same result.
PROBLEM IN THONNY'S BACK-END: Internal error (serial.serialutil.SerialTimeoutException: Write timeout). See Thonny's backend.log for more info. You may need to press "Stop/Restart" or hard-reset your MicroPython device and try again. Process ended with exit code 0. help
There are a few things that may be giving you that issue, check that: 1. The Pico is correctly plugged in. 2. You have selected the right COM port in the bottom right, it should say "MicroPython (Raspberry Pi Pico)" 3. Ensure you have correctly installed MicroPython, and the right version of it. (If you have a Pico W, install the PicoW /WH option). You can reinstall it using the same steps to ensure it's correct. If all of these fail, feel free to chuck a post on our forum topic dedicated to this video, we have lots of maker eyes over there that can help! forum.core-electronics.com.au/t/how-to-use-raspberry-pi-pico-with-thonny/9226/14
I think I had the same thing happen, you have to change your interpreter. To do that, under "Run", select interpreter and change it to Pi Pico. If you dont have that option, in the top right there should be a line "change to default" or something like that. Press that, restart Thonny and you should have the option under run. Hope that helps
I get "Couldn't find the device automatically. Check the connection (making sure the device is not in bootloader mode) or choose "Configure interpreter" in the interpreter menu (bottom-right corner of the window) to select specific port or another interpreter.%Run -c $EDITOR_CONTENT". So at what point do I unplug and replug the Pico ? I assume that I'm still in "bootloader" mode until I do ? Even that does not work, so where to go from here. This device appears to be so new to the market, that no one has released a RUclips video that fully explains the pitfalls.
It sounds like there could be a bit going on here. We have a dedicated forum topic for this tutorial, and full-time technical support staff who can help forum.core-electronics.com.au/t/how-to-use-raspberry-pi-pico-with-thonny/9226
Hey Troy, the Pico W uses pin 25 for its wireless chip, so now you control the led pin with "LED", instead of 25. Old Line: led = Pin(25, Pin.OUT) New Line: led = Pin("LED", Pin.OUT) This should work for all Pico variants as well.
Me too, Cyrus !!!! I see your comment was made 1 month ago. Is anyone checking our comments, or should we be posting them on "Core Electronics's" forum ? I took a look there, but unable to navigate to any assistance. May need to unsubscribe to this channel if that's all the support they can offer !!!! I here repeat your question: "from machine import Pin" when I run this, it say cannot find module 'machine' Any solutions ?
@@RudiOnRails Sorry no. I'm still using the pi ide and it's so slow. I want to use visual studio code and eventually write some assembly so I can try write my own version of forth.
Hello @Core-Electronics my program is suddently inable to regonize my devis ? Unable to connect to COM6: could not open port 'COM6': OSError(22, 'Le délai de temporisation de sémaphore a expiré.', None, 121) Process ended with exit code 1.
For the other Pico W / Pico WH owners out there: to get the blinking LED to work you need to swap out 25 on line 4 for 'LED'.
So from:
led = Pin(25, Pin.OUT)
to:
led = Pin('LED', Pin.OUT)
LOL, I was just coming back to make the same comment; wish I'd scrolled down 20 minutes ago...
You're a lifesaver, got worried I messed up lol
led = Pin("LED", Pin.OUT)
double quotes.
@@wayland7150 Both work
@@aaronmorgan4466 same here
This is by far the best introductory video for the Pico I've seen on RUclips. Very easy to follow, and everything worked fine. Thank you very much for getting me off the ground with it. Would love to see more in a similar vein. Pressing the subscribe button now!
Please don't stop making these videos! They are by far the best on this subject. Thanks for these!
Both your REPL guide and this one have been extremely easy to follow and a bit of a life saver. I was getting in a bit of a muddle from the setup pdf from the pi foundation on how to set up the pi, setting up cmake and all sorts of other things for vscode etc etc. Why they didn't just have a simple "Use Thonny in this simple way" is a bit beyond me but there you go
Thanks Ben, all the best with your projects!
You cleared my Machine module problem. Loading the correct interpreter. Great clip for beginners..Thanks Don
Thanks buddy! I´ve just received my first pair of RP Picos, and have´nt had much luck communicating with the board, till I watched this video. We´re blinkin´!!! ;)
this is the best explanation of Pico and thonny, all other videos just assume that you know how to use thonny although they title their videos : for Absolute Beginners !!! (which is my case. :) ) ... thanks a lot !!! . hope you can show us a step by step video of building and programming a simple pico robot
Ok I found it. Tools > Options > Interpreter > Port Don't know why I didn't see it before!
Awesome content!
A shining example how a tech tutorial sould be👍
I appreciate that!
Thank you for making this video. I'm a complete noob and you helped me get started. 👍
Outstanding! You explain things so well. And I needed that!
i made a watch dial in pygame and im trying to covert to micropython will that work?
Thanks a lot. Was stuck in the proces descriped in my textbook, this just worked!
Thanks for the info. I was up and running in no time. Many Thanks again.
Thank you for this video. I think that the most impotant lesson is to save your final file as main.py in the root directory of the RP2040 zero.
Super appreciate you posting this!!
Thanks, how do i stop the pico from executing the program?
Throw it away and get another pico.
Thanks for this, I have been trying to workout how you view saved files on the Pico
Complete novice here. So let's say the pico is powered from a power supply instead of a computer. And then at 6:06 pico loses power which can easily happen. And then power comes back on. Should the code autostart or does it need to be connected to a computer again and with thonny stop/restart code and ctrl+D ?
If you save the name of your code onto the Pico as main.py then it will automatically run when power is connected, otherwise you will need to reconnect to Thonny and restart the code.
I downloaded thonny on my ubuntu couldn't see pico option in there..
had to download it on windows to work with it.. It would be a lot of help if you could make a video for ubuntu users as well..
Great video BTW i enjoyed it very much
Probably you have older version of Thonny. Remove it and install through : pip3 install thonny
does anyone know why i get an error code when i try and download packages within python
another good video on the Pico
Blink LED code for Raspberry Pi Pico W:
import machine
import time
led = machine.Pin('LED', machine.Pin.OUT)
while (True):
led.on()
time.sleep(.2)
led.off()
time.sleep(.2)
so helpfull thx very much i'm beginner with pico and that learn me so many things
Great video, I've followed it to the letter, unplugged it but now the green light stays on solid and cant stop it? thanks
I found this video very helpful and I really wanted you to know that!
That's great to hear 😃 Thanks, and best of luck with your projects!
I have had trouble in finding code you run on strip leds running pi pico any help please internal code led worked fine. I keep error example code 1 from raspberry pi pi pico libaray line no name pixel? Any help anyone.
hello, enjoying your videos but struggling to get anything to work on my pico. my project isnt compicated. just need a couple of outputs triggers when given an input. basic switches etc. cant seem to get any coding to work.
I am a bit confused because i have done every step as described but the led doesn't do anything. The printed part is updating all the time when i run the program but the led not. What may be the problem?
Hey sorry for the late reply, if you are using a Pico W, they have changed how you reference the LED pin. It used to be pin 25 (but now that is used by the Wi-Fi chip), so you will need to change 25 with "LED", so that line will look like:
led = Pin("LED", Pin.OUT)
We have update our writte guide, and Ill Pin dnywh's comment who answers this so that other can find it more easily!
@@Core-ElectronicsOhh thanks !!
if using Pico W, replace 25 with "LED", debugged this for half a day lol
Exactly what I needed, thank you
Glad it helped!
how to clean up gpio pico when exiting/stopping code in Thonny. Now ...when I stop the code the led stays on...
How run micropython Pico on 32bit Ubuntu machine?
Can someone plz explain why it is useful to have ur pico printing numbers and what would be a scenario I need to use it in
This example of printing was just a demo, but print commands are incredibly helpful for debugging. If you have code that makes a series of decisions, you can put print statements in those decisions and see how it is "thinking". You might also want to double check that you are converting numbers correctly (maybe your sensor reads in Celsius and you need to convert to Fahrenheit), so your might print it out to double check that the Pico is calculating it correctly.
@@Core-Electronics what commands do I use to see what my pico is thinking🤔
Hi, great video! May I ask you a question? I have a pico W but I can't get REPL to work! Thonny keeps telling me that the device is busy, i tried soft rebooting, pressing ctrl+d, ctrl+c, tried connecting pin 30 or RUN to ground for a soft reboot, but nothing, even tried deleting code.py from the pi. I am running Circuit Python 8.1, i don't know if it is my pi the problem, please do you have any suggestion?
Nice video, I am wondering, instead of using sleep, is there a way to flash the LED while a code is running on the PICO, like to run the flash led parallel to another program that's running. I don't know if it have to run in a different thread or how this would be approached.
Certainly - this is called non-blocking code. Look up how to use ticks_ms() and scheduling.
@@Core-Electronics thank you very much
Hi, I'm more of a C/C++ type of person.
Is there anyway i can use the Plotter and the Shell in Thonny as an output for my C codes on the pico ??
I've written a code in C to output data for proximity sensor but minicom, putty and the arduino console can't detect uart output.
is this close to the same with the PI zero? Can I connect the PI zero?/
suppose if i close thonny then LED will stop working.in arduino if we close arduino IDE still project runs on board.likewise how it can be happen in pico?
Many thanks, this was very helpful.
hi, I am dragging and dropping uf2 file onto rp2 drive, it dispears but I can't find micro python from drop down in Thornny in Interpretor drop down in options. can you help?
The best way to get technical help for any of our content is on the forums: forum.core-electronics.com.au/
We're full-time makers and are on the forums every working day!
every thing is working fine , Program is getting executed by "Run" option, but there is no "download" option to burn the micropython program in the flash memory.
When I am removing USB Plug from laptop blinking of LED stopped because it is not getting power through USB it is Ok, but when I am reconnecting USB with 3 second pressing of USB and port is also showing connected , then also LED is not blinking,
unless I again "run" the program, that means program is not getting burnt in flash memory ,
How it can be done
(this type of problem is not there with Arduino board)
One quick question how do I change the Port setting in Thonny, Thonny thinks my pico is at port 13 and my computer thinks the pico is at port 14.
I have to edit the configuration.ini file, Port = setting but it keeps reverting back to Port = 13
Anyone else having issue getting the led to flash on win+Pico, go to run>run current script.
Shame that Thonny on Linux does not support the pico out of the box with version 3.2.7. This tutorial does work on a MAC x86 as of today.
needs 3.3.3+ , no shame, things evolve, this pico board is not even 6 months old,
I am getting errors when I try to run a program which uses ssd1306 display module in version 4.1.4. how to fix it sir
Hey, we have a community forum with lots of maker eyes that can help, feel free to chuck a post on there with some information about your code, wiring, etc.
forum.core-electronics.com.au/
Does it work on W and I'm trying to work it on W and it's not working
Awesome video man! Thanks
I'm on a mac. No go with your instructions. At this point the ESP32 seemed easier to get going. It's like there is a step missing I'm not seeing from the RPI documentation or your video to get going.
I ... actually did not know that about the plotter thing... huh... does that only work if you do the { } stuff for the print statement? Aka, can I just use simple concatenation instead of { } ? (It's not a problem, I can start using { } , but my brain just default's to concatenation XD )
It works for regular printed messages. (Regular in the sense that the format is unchanging). Just make sure to only print one message per loop. Thonny will detect the format and put in the plot labels automatically.
So, yes, it will work for concatenated prints too!
Downloaded Thonny and get a Site Certificate Expired error. Even after manually installing MicroPython 1.18 onto the Pico. Been trying to fix this error for 2 days now.
Did you ever find a fix to this? I'm having a similar problem
can anyone help me with the pico. It keeps rebooting everytime i try to install micropython in it. also even i do not press the bootsel button it still opens as a removable drive
and by rebooting i mean i doesnt install micropython but just closes and opens as a drive again
Hi! Thanks you for this good introduction. On my Seven system I needed Zadig for Windows to get the good driver ;)
Am having an error (can't import name pin)
Please I need help
Made it as far as 'from machine import pin' . 'No module named machine. Looked at 'manage packages' No machine there either. Tried pip and pip3 with the same result.
This works perfect, thanks bro
Great guide! Subscribed.
Do we have to install micro python on the pico first, or is it pre-installed?
Yes - download it from the raspberry pi foundation and it is a simple drag and drop operation
Are you saying CTRL- A, D or V?
Soft reboot is CTRL + D
@@Core-Electronics - Thanks, could not understand what you said.
Thank you for the nice presentation. can you make a demo how of how to use this device with hx771 ADC ?
How to use an android smart phone to program and send it to pi pico?
DOES THONNY IDE WORK ONLY ON WINDOWS 10?
Thanks, very nice video
Keep in mind, this led code is for the regular Pico, NOT the Pico W. Great tutorial, thx!
@OG duolingo man led = Pin("LED", Pin.OUT)
I was so confused
PROBLEM IN THONNY'S BACK-END: Internal error (serial.serialutil.SerialTimeoutException: Write timeout).
See Thonny's backend.log for more info.
You may need to press "Stop/Restart" or hard-reset your MicroPython device and try again.
Process ended with exit code 0.
help
There are a few things that may be giving you that issue, check that:
1. The Pico is correctly plugged in.
2. You have selected the right COM port in the bottom right, it should say "MicroPython (Raspberry Pi Pico)"
3. Ensure you have correctly installed MicroPython, and the right version of it. (If you have a Pico W, install the PicoW /WH option). You can reinstall it using the same steps to ensure it's correct.
If all of these fail, feel free to chuck a post on our forum topic dedicated to this video, we have lots of maker eyes over there that can help!
forum.core-electronics.com.au/t/how-to-use-raspberry-pi-pico-with-thonny/9226/14
Thonny says pyhon is 3.10 but I have 3.11 so my code wont work
Hey! Great video. I wonder how to log an excel sheet with Micropython. I hope anyone can help me. Thanks
You simply write data to a file separated by commas. Add a new line for new data. Name it with the .csv extension. Excel will take care of the rest.
when i try to install or update firmware it says error
Did you ever find a fix to this? I'm having the same problem
can u use java
Please letWhich is the best raspberry Pico or Arduino ?
There are lots of Arduino versions out there, though Pico has our heart for the moment! It is after all, the latest microcontroller on Earth :)
@@Core-Electronics I think Pico is faster and easier to interface with the raspberry Pi ... the mother and the daughter..
Computer said: NOOOO. No module called machine
What want to do you mean bro?
Hi, you came after one year!!!@@uzb_coder
Bash: python:machine not found
My computer said buddy go back to your schoolwork
You must be using a charging cable not a data cable
got an error . ModuleNotFoundError: No module named 'serial.tools' installed serial,pyserial but couldnt get it to work. got any suggestions?
I think I had the same thing happen, you have to change your interpreter. To do that, under "Run", select interpreter and change it to Pi Pico. If you dont have that option, in the top right there should be a line "change to default" or something like that. Press that, restart Thonny and you should have the option under run. Hope that helps
I get "Couldn't find the device automatically.
Check the connection (making sure the device is not in bootloader mode) or choose
"Configure interpreter" in the interpreter menu (bottom-right corner of the window)
to select specific port or another interpreter.%Run -c $EDITOR_CONTENT".
So at what point do I unplug and replug the Pico ? I assume that I'm still in "bootloader" mode until I do ?
Even that does not work, so where to go from here.
This device appears to be so new to the market, that no one has released a RUclips video that fully explains the pitfalls.
It sounds like there could be a bit going on here. We have a dedicated forum topic for this tutorial, and full-time technical support staff who can help forum.core-electronics.com.au/t/how-to-use-raspberry-pi-pico-with-thonny/9226
I guess I have a Pico W which the script doesn't work for.
Hey Troy, the Pico W uses pin 25 for its wireless chip, so now you control the led pin with "LED", instead of 25.
Old Line:
led = Pin(25, Pin.OUT)
New Line:
led = Pin("LED", Pin.OUT)
This should work for all Pico variants as well.
That install is not coming
thanks
You're welcome!
Me too, Cyrus !!!! I see your comment was made 1 month ago. Is anyone checking our comments, or should we be posting them on "Core Electronics's" forum ?
I took a look there, but unable to navigate to any assistance. May need to unsubscribe to this channel if that's all the support they can offer !!!!
I here repeat your question: "from machine import Pin" when I run this, it say cannot find module 'machine' Any solutions ?
Anyone else getting CERTIFICATE_VERIFY_FAILED when clicking install?
Had to install lets-encrypt-r3.der for it to start working.
that totaly failed from start dint work at all
good video
Thanks a trillion
sweet
thanks bro
I get a certificate expired error
Same here did you ever resolve this?
@@RudiOnRails Sorry no. I'm still using the pi ide and it's so slow. I want to use visual studio code and eventually write some assembly so I can try write my own version of forth.
No semi colon, curly braces and any other annoying things that the Arduino IDE and C++ has
Yo, thats not red.. Thats green, you colorblind?
dont work
😮😱🙀🙀🙀🙀🙀
Hello @Core-Electronics my program is suddently inable to regonize my devis ? Unable to connect to COM6: could not open port 'COM6': OSError(22, 'Le délai de temporisation de sémaphore a expiré.', None, 121)
Process ended with exit code 1.
I'm fine thank you for that course :) I change my open port and reboost it
the code don't work!!!
Your keyboard is very loud, perhaps don’t aim your boom mic downward to avoid that loud keyboard clicking sound!
I don't understand why you new to download a whole new ide just to write python scripts to a micro controler. This sounds so stupid.
why is micro python so slowwwwwwwwwwwwwww
i mean slow
Doesn’t work.
It's not funny.