How to Setup a Raspberry Pi Pico and Code with Thonny

Поделиться
HTML-код
  • Опубликовано: 16 дек 2024

Комментарии • 158

  • @dnywh
    @dnywh 2 года назад +75

    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)

    • @aaronmorgan4466
      @aaronmorgan4466 2 года назад +9

      LOL, I was just coming back to make the same comment; wish I'd scrolled down 20 minutes ago...

    • @commanderpandesoft
      @commanderpandesoft Год назад +2

      You're a lifesaver, got worried I messed up lol

    • @wayland7150
      @wayland7150 Год назад +5

      led = Pin("LED", Pin.OUT)
      double quotes.

    • @pickledorange
      @pickledorange Год назад +2

      @@wayland7150 Both work

    • @nathanielpoulton2460
      @nathanielpoulton2460 Год назад

      @@aaronmorgan4466 same here

  • @videosonix4473
    @videosonix4473 Год назад +15

    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!

  • @emanuelefavero
    @emanuelefavero 3 года назад +11

    Please don't stop making these videos! They are by far the best on this subject. Thanks for these!

  • @philosophyben
    @philosophyben 3 года назад +15

    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

  • @Dbean48
    @Dbean48 2 года назад +3

    You cleared my Machine module problem. Loading the correct interpreter. Great clip for beginners..Thanks Don

  • @Mumme666
    @Mumme666 3 года назад +3

    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´!!! ;)

  • @hballouz
    @hballouz Год назад +1

    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

  • @mahoneytechnologies657
    @mahoneytechnologies657 3 года назад +3

    Ok I found it. Tools > Options > Interpreter > Port Don't know why I didn't see it before!

  • @jannsander
    @jannsander 2 года назад +8

    Awesome content!
    A shining example how a tech tutorial sould be👍

  • @JoeSteffy1932
    @JoeSteffy1932 Год назад +1

    Thank you for making this video. I'm a complete noob and you helped me get started. 👍

  • @alevans51
    @alevans51 4 дня назад

    Outstanding! You explain things so well. And I needed that!

  • @J.S.McDuff
    @J.S.McDuff Год назад

    i made a watch dial in pygame and im trying to covert to micropython will that work?

  • @runepedersenDK
    @runepedersenDK 3 месяца назад

    Thanks a lot. Was stuck in the proces descriped in my textbook, this just worked!

  • @MattBaker1965
    @MattBaker1965 3 месяца назад

    Thanks for the info. I was up and running in no time. Many Thanks again.

  • @SciHeartJourney
    @SciHeartJourney 11 месяцев назад

    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.

  • @mathewrtaylor
    @mathewrtaylor 3 года назад +1

    Super appreciate you posting this!!

  • @MrPrathampatil
    @MrPrathampatil 3 года назад +4

    Thanks, how do i stop the pico from executing the program?

    • @wayland7150
      @wayland7150 Год назад

      Throw it away and get another pico.

  • @paulnielson8266
    @paulnielson8266 3 года назад +1

    Thanks for this, I have been trying to workout how you view saved files on the Pico

  • @qus.9617
    @qus.9617 Год назад

    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 ?

    • @Core-Electronics
      @Core-Electronics  Год назад +1

      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.

  • @prateeksrivastava8470
    @prateeksrivastava8470 3 года назад +4

    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

    • @bodziobran
      @bodziobran 3 года назад +1

      Probably you have older version of Thonny. Remove it and install through : pip3 install thonny

  • @retrobombstudios1258
    @retrobombstudios1258 Год назад +1

    does anyone know why i get an error code when i try and download packages within python

  • @mwilliams0303
    @mwilliams0303 3 года назад +2

    another good video on the Pico

  • @shamanthks7218
    @shamanthks7218 2 года назад +2

    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)

  • @elujarcaos
    @elujarcaos Год назад

    so helpfull thx very much i'm beginner with pico and that learn me so many things

  • @scripterman
    @scripterman Год назад

    Great video, I've followed it to the letter, unplugged it but now the green light stays on solid and cant stop it? thanks

  • @3DSage
    @3DSage 2 года назад

    I found this video very helpful and I really wanted you to know that!

    • @Core-Electronics
      @Core-Electronics  2 года назад

      That's great to hear 😃 Thanks, and best of luck with your projects!

  • @Videogame9559
    @Videogame9559 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.

  • @MultiShaun1989
    @MultiShaun1989 2 года назад

    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.

  • @nikos4586
    @nikos4586 5 месяцев назад

    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?

    • @Core-Electronics
      @Core-Electronics  5 месяцев назад +1

      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!

    • @nikos4586
      @nikos4586 5 месяцев назад

      @@Core-ElectronicsOhh thanks !!

  • @icaruscomplex5588
    @icaruscomplex5588 2 года назад +2

    if using Pico W, replace 25 with "LED", debugged this for half a day lol

  • @Jodie842
    @Jodie842 5 месяцев назад

    Exactly what I needed, thank you

  • @geirha75
    @geirha75 2 года назад

    how to clean up gpio pico when exiting/stopping code in Thonny. Now ...when I stop the code the led stays on...

  • @joeshmoe7899
    @joeshmoe7899 2 года назад +1

    How run micropython Pico on 32bit Ubuntu machine?

  • @PushUp-yt5is
    @PushUp-yt5is 8 месяцев назад

    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

    • @Core-Electronics
      @Core-Electronics  8 месяцев назад

      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.

    • @PushUp-yt5is
      @PushUp-yt5is 8 месяцев назад

      @@Core-Electronics what commands do I use to see what my pico is thinking🤔

  • @antospin4004
    @antospin4004 Год назад

    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?

  • @cutsdbz
    @cutsdbz 2 года назад

    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.

    • @Core-Electronics
      @Core-Electronics  2 года назад

      Certainly - this is called non-blocking code. Look up how to use ticks_ms() and scheduling.

    • @cutsdbz
      @cutsdbz 2 года назад +1

      @@Core-Electronics thank you very much

  • @robotboy3525
    @robotboy3525 Год назад

    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.

  • @RandomPickles
    @RandomPickles 2 года назад

    is this close to the same with the PI zero? Can I connect the PI zero?/

  • @rohiniik
    @rohiniik 3 года назад

    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?

  • @steveaustin62
    @steveaustin62 Год назад

    Many thanks, this was very helpful.

  • @kiransalan8179
    @kiransalan8179 2 года назад

    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?

    • @Core-Electronics
      @Core-Electronics  2 года назад

      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!

  • @uttamdutta3664
    @uttamdutta3664 3 года назад

    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)

  • @mahoneytechnologies657
    @mahoneytechnologies657 3 года назад

    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

  • @10001000101
    @10001000101 Год назад

    Anyone else having issue getting the led to flash on win+Pico, go to run>run current script.

  • @GeorgeKowalski
    @GeorgeKowalski 3 года назад +1

    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.

    • @jyvben1520
      @jyvben1520 3 года назад +1

      needs 3.3.3+ , no shame, things evolve, this pico board is not even 6 months old,

  • @isaidokie
    @isaidokie 6 месяцев назад

    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

    • @Core-Electronics
      @Core-Electronics  6 месяцев назад

      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/

  • @robloxplayer_and_meowshit_3527

    Does it work on W and I'm trying to work it on W and it's not working

  • @seanswartz9033
    @seanswartz9033 8 месяцев назад

    Awesome video man! Thanks

  • @TomParish
    @TomParish 2 года назад

    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.

  • @noicthebrave
    @noicthebrave 2 года назад

    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 )

    • @Core-Electronics
      @Core-Electronics  2 года назад +1

      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!

  • @kentharris7427
    @kentharris7427 2 года назад

    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.

    • @laslak37
      @laslak37 2 года назад

      Did you ever find a fix to this? I'm having a similar problem

  • @aringangal6614
    @aringangal6614 3 года назад

    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

    • @aringangal6614
      @aringangal6614 3 года назад

      and by rebooting i mean i doesnt install micropython but just closes and opens as a drive again

  • @paulpomme2502
    @paulpomme2502 2 года назад

    Hi! Thanks you for this good introduction. On my Seven system I needed Zadig for Windows to get the good driver ;)

  • @teddybless2904
    @teddybless2904 Год назад

    Am having an error (can't import name pin)
    Please I need help

  • @Gndt1
    @Gndt1 Год назад

    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.

  • @gilangjanuar3552
    @gilangjanuar3552 9 месяцев назад

    This works perfect, thanks bro

  • @phrtza
    @phrtza Год назад

    Great guide! Subscribed.

  • @NotMarkKnopfler
    @NotMarkKnopfler 3 года назад

    Do we have to install micro python on the pico first, or is it pre-installed?

    • @ianbertenshaw4350
      @ianbertenshaw4350 3 года назад +1

      Yes - download it from the raspberry pi foundation and it is a simple drag and drop operation

  • @tubeDude48
    @tubeDude48 2 года назад

    Are you saying CTRL- A, D or V?

    • @Core-Electronics
      @Core-Electronics  2 года назад +1

      Soft reboot is CTRL + D

    • @tubeDude48
      @tubeDude48 2 года назад +1

      @@Core-Electronics - Thanks, could not understand what you said.

  • @tedrostesfaab1838
    @tedrostesfaab1838 2 года назад

    Thank you for the nice presentation. can you make a demo how of how to use this device with hx771 ADC ?

  • @reddoglavrador
    @reddoglavrador 3 года назад

    How to use an android smart phone to program and send it to pi pico?

  • @Gayatri02
    @Gayatri02 3 года назад

    DOES THONNY IDE WORK ONLY ON WINDOWS 10?

  • @Parcha24
    @Parcha24 5 месяцев назад

    Thanks, very nice video

  • @midwifeymomkempjj258
    @midwifeymomkempjj258 2 года назад +5

    Keep in mind, this led code is for the regular Pico, NOT the Pico W. Great tutorial, thx!

  • @RepeatVR
    @RepeatVR 2 месяца назад

    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

    • @Core-Electronics
      @Core-Electronics  2 месяца назад

      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

  • @CyberRRoland
    @CyberRRoland Год назад

    Thonny says pyhon is 3.10 but I have 3.11 so my code wont work

  • @pravinrajan1542
    @pravinrajan1542 3 года назад

    Hey! Great video. I wonder how to log an excel sheet with Micropython. I hope anyone can help me. Thanks

    • @phil2268
      @phil2268 2 года назад

      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.

  • @mushedpotatoesking7484
    @mushedpotatoesking7484 3 года назад

    when i try to install or update firmware it says error

    • @laslak37
      @laslak37 2 года назад

      Did you ever find a fix to this? I'm having the same problem

  • @Beanbag59
    @Beanbag59 10 месяцев назад

    can u use java

  • @abedoubari
    @abedoubari 3 года назад

    Please letWhich is the best raspberry Pico or Arduino ?

    • @Core-Electronics
      @Core-Electronics  3 года назад +3

      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 :)

    • @abedoubari
      @abedoubari 3 года назад

      @@Core-Electronics I think Pico is faster and easier to interface with the raspberry Pi ... the mother and the daughter..

  • @mingosutu
    @mingosutu 2 года назад +4

    Computer said: NOOOO. No module called machine

    • @uzb_coder
      @uzb_coder 11 месяцев назад +2

      What want to do you mean bro?

    • @mingosutu
      @mingosutu 11 месяцев назад

      Hi, you came after one year!!!@@uzb_coder

    • @Ar1yan824
      @Ar1yan824 6 месяцев назад

      Bash: python:machine not found

    • @Yippee2012
      @Yippee2012 3 месяца назад

      My computer said buddy go back to your schoolwork

    • @ilikepenguins6672
      @ilikepenguins6672 Месяц назад

      You must be using a charging cable not a data cable

  • @rverm1000
    @rverm1000 3 года назад

    got an error . ModuleNotFoundError: No module named 'serial.tools' installed serial,pyserial but couldnt get it to work. got any suggestions?

    • @pixel_arc8550
      @pixel_arc8550 3 года назад

      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

  • @kevingpearce
    @kevingpearce 3 года назад

    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.

    • @Core-Electronics
      @Core-Electronics  3 года назад

      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

  • @TroyBrophy
    @TroyBrophy Год назад

    I guess I have a Pico W which the script doesn't work for.

    • @Core-Electronics
      @Core-Electronics  Год назад +1

      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.

  • @Setssquare
    @Setssquare 3 года назад

    That install is not coming

  • @caspianscontent
    @caspianscontent 2 года назад +1

    thanks

  • @kevingpearce
    @kevingpearce 3 года назад

    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
    @RudiOnRails 2 года назад

    Anyone else getting CERTIFICATE_VERIFY_FAILED when clicking install?

    • @RudiOnRails
      @RudiOnRails 2 года назад

      Had to install lets-encrypt-r3.der for it to start working.

  • @thediscoman2001
    @thediscoman2001 11 месяцев назад

    that totaly failed from start dint work at all

  • @palanikumaravels3088
    @palanikumaravels3088 3 года назад

    good video

  • @natorverinumbe3161
    @natorverinumbe3161 9 месяцев назад

    Thanks a trillion

  • @stevenchan9885
    @stevenchan9885 2 года назад +1

    sweet

  • @nileshpathak9443
    @nileshpathak9443 3 года назад

    thanks bro

  • @tetraquark2402
    @tetraquark2402 2 года назад

    I get a certificate expired error

    • @RudiOnRails
      @RudiOnRails 2 года назад

      Same here did you ever resolve this?

    • @tetraquark2402
      @tetraquark2402 2 года назад

      @@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.

  • @ianbertenshaw4350
    @ianbertenshaw4350 3 года назад

    No semi colon, curly braces and any other annoying things that the Arduino IDE and C++ has

  • @kevinstampe
    @kevinstampe 3 года назад

    Yo, thats not red.. Thats green, you colorblind?

  • @thediscoman2001
    @thediscoman2001 4 месяца назад

    dont work

  • @ashutoshtechnology
    @ashutoshtechnology 7 месяцев назад

    😮😱🙀🙀🙀🙀🙀

  • @anaislafontaine6172
    @anaislafontaine6172 Год назад

    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.

    • @anaislafontaine6172
      @anaislafontaine6172 Год назад

      I'm fine thank you for that course :) I change my open port and reboost it

  • @manuelfreitas4526
    @manuelfreitas4526 Год назад

    the code don't work!!!

  • @stephenwong9723
    @stephenwong9723 3 года назад

    Your keyboard is very loud, perhaps don’t aim your boom mic downward to avoid that loud keyboard clicking sound!

  • @Vulto166
    @Vulto166 4 месяца назад

    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.

  • @nathvandyk5213
    @nathvandyk5213 2 года назад

    why is micro python so slowwwwwwwwwwwwwww
    i mean slow

  • @russianorctrash6591
    @russianorctrash6591 10 месяцев назад

    Doesn’t work.

  • @alperenalperen2458
    @alperenalperen2458 3 года назад

    It's not funny.