How to Use VSCode with Raspberry Pi Pico W and MicroPython

Поділитися
Вставка
  • Опубліковано 16 лип 2024
  • Learn how to get set up and start writing code in MicroPython using VSCode (Visual Studio Code). This can have many benefits over coding in Thonny which is notoriously a buggy IDE.
    Link to Medium Article:
    / how-to-use-vscode-with...
    Link to Blog Post:
    shillehtek.com/blogs/news/how...
    Other IDE Tutorials:
    How to Use PyCharm with Pico: • How to Use PyCharm wit...
    How to Use Arduino IDE with Pico: • How to Use Arduino IDE...
    How to Run Scripts without an IDE:
    • How to Run Code & Mana...
    TIMESTAMPS
    00:00 Intro
    00:45 Install MicroPython
    02:20 Pico-W-Go Extension Walkthrough
    06:03 Outro
  • Наука та технологія

КОМЕНТАРІ • 89

  • @mmshilleh
    @mmshilleh  7 місяців тому +3

    Consider joining a membership on the channel to obtain more perks to help you with your IoT and software journey and to support the channel! We have three levels. 🥰

  • @danahuff6823
    @danahuff6823 11 місяців тому +34

    The newest version of Pico-W-Go, now renamed MicroPico, includes the ability to display the file system on the Pico. Now I feel comfortable moving from Thonny to VSC.

    • @mmshilleh
      @mmshilleh  11 місяців тому

      This is great news yeah I will probably do the same at this point.

    • @philippelouapre
      @philippelouapre 7 місяців тому

      Hi. Could you please provide the way to display the file system on the pico through VSCode? I do not see the solution. Thanks!

    • @brianlmerritt
      @brianlmerritt 6 місяців тому

      @@philippelouapre He did that in part 2, just recently

  • @Penofhell
    @Penofhell 11 місяців тому +34

    Pico-W-Go is now named MicroPico

    • @mmshilleh
      @mmshilleh  11 місяців тому +4

      Thanks I will Pin this they keep changing the name for it haha

    • @MaxPanic
      @MaxPanic 10 місяців тому

      Thanks! Was wondering if I had the right extension.

  • @HopWorksET
    @HopWorksET Рік тому +3

    Another well made fast video to get you started with this device and VSC!! What is amazing is the videos you put out already are right down the path I am following! For example, I got a MPU4060 and a GPS module for my car computer and sure enough, you have a few videos on it! Then next, I wanted to code for my whole project using VSC, including the RPI Pico W, and here I am!
    ONE THING WORTH NOTING - I got errors when I tried to use the extension. I actually had Pico-Go still installed and it does NOT play nice with Pico-W-Go. So check if you have Pico-Go and either disable or uninstall it before installing the newer version. THANKS AGAIN Shilleh for the VERY useful contribution!! {already-subscribed.liked.saved}

    • @mmshilleh
      @mmshilleh  Рік тому

      Wow, that truly means a lot. Yeah, the premise of this channel is to show things that were initially hard for me to figure out online. Really glad it is paying off and helping people honestly, so thanks a lot. Hope to make more Raspberry Pi content when I get back to America in a few weeks!

  • @ath0rus
    @ath0rus 9 місяців тому +1

    I find this the best way to use a pi pico and the setup is very well explained, I think my pi friends will love this. I got 2x pico's (Pico H and Pico WH) to try and see how they work plus be a gpio for my desktop or laptop

    • @mmshilleh
      @mmshilleh  9 місяців тому

      Yes you should show everyone you know Really happy you like it, it is indeed a great way to use the Pico!

  • @BendsSpace
    @BendsSpace Рік тому +3

    Great tutorial! I really appreciate you making this, I found it very helpful :)

    • @mmshilleh
      @mmshilleh  Рік тому

      Wow that means a lot yeah helped a lot more people than I thought it would tbh 😜.

  • @surfbort
    @surfbort 6 місяців тому +1

    Thanks mate made getting started with micropython on my RP2040-Touch-LCD-1.28 very easy!

    • @mmshilleh
      @mmshilleh  6 місяців тому

      I am happy to hear that, I hope you can subscribe for more!

  • @user-rk3wu3lk7t
    @user-rk3wu3lk7t Рік тому +2

    Thanks for this tutorial!

    • @mmshilleh
      @mmshilleh  Рік тому

      Anytime ;) dont forget to subscribe

  • @user-hs2nm8tf2d
    @user-hs2nm8tf2d 5 місяців тому +1

    Works for me. Thank you!

    • @mmshilleh
      @mmshilleh  5 місяців тому

      You're welcome! Please subscribe to the channel if you enjoyed it!

  • @justineno4254
    @justineno4254 2 місяці тому +1

    Very helpful. Thank you.

    • @mmshilleh
      @mmshilleh  2 місяці тому

      Glad it was helpful! Hope I earned your subscription to the channel , would help me out a lot!

  • @ender_relics
    @ender_relics Рік тому +2

    thanks, it i exactly what i looking for

    • @mmshilleh
      @mmshilleh  Рік тому

      Your comment is highly appreciated thank you

  • @dancingrook8553
    @dancingrook8553 Місяць тому +1

    Thank you, I like VSCode and when I first saw Thonny I thought nup I'm finding out how to do this in VSCode.....so yeah thank you

    • @mmshilleh
      @mmshilleh  Місяць тому

      Happy to help! Hope you can subscribe :)

  • @Mr.FarePlay
    @Mr.FarePlay Рік тому +5

    You reduced my installation time from a whole day to 6 minutes 😂 i thank you kind sir 👍❤️

    • @mmshilleh
      @mmshilleh  Рік тому +1

      I appreciate your comment a lot! Means a lot that I am saving other Engineers and students a lot of time. I will continue to make my content around helping you all to get started quickly !

  • @cotyhamilton
    @cotyhamilton 11 місяців тому +1

    thank you!

    • @mmshilleh
      @mmshilleh  11 місяців тому

      Happy you liked it, do not forget to smash that subscribe button!

  • @thespacecowboy420
    @thespacecowboy420 7 місяців тому +1

    thanks

  • @chrisa4985
    @chrisa4985 Рік тому +2

    Followed your steps, but my VS says "Pico Connected", not Pico W, down the bottom on the blue bar. And when I try right-clicking on the Blink-Sketch file, to select 'Pico-W-Go > Run current file', that's greyed out. Can't use that. Any ideas?

    • @mmshilleh
      @mmshilleh  Рік тому

      Hey Chris, did you download the latest version of MicroPython for the Pico W and port it over. Also, be sure to check your python version and see if it is 3.9 or greater. Type in python --version or python3 --version in the command line in VSCode. Another thing I would try if that does not work is to check if your USB cable is the proper USB cable. See if you can connect in Thonny which is more straightforward. If you are new to the Raspberry Pi Pico it may be you have the wrong type of USB cable. Not all cables transfer data.

  • @reinaldomenendez7593
    @reinaldomenendez7593 8 місяців тому +1

    Great video. You saved me after 2h of trying. One question, how do I make this file consistent in my pico? I mean, I want that LED blinks every time I disconnetc/connect it again

    • @mmshilleh
      @mmshilleh  8 місяців тому

      Thats a good question, to make a code instantly activate upon power up you can add the code to the main.py file of the home directory on your Pico. This is the file the Pico tries to execute upon turning on. Hope that answers your question and you subscribe!

  • @mmshilleh
    @mmshilleh  Рік тому +2

    If this helped you please consider supporting the channel at www.buymeacoffee.com/mmshilleh or if you want to book a chat with me.
    Please remember to sub to the channel if you have not, would be highly appreciated! Thanks!

  • @jbelmont72
    @jbelmont72 7 місяців тому

    Great video and teaching. You made it look easy AND it worked. Question- I read your answer about adding libraries from GitHub straight onto the pico. You mentioned a “lib” folder. Do we make a folder in a text editor, then put a library like BME280 into it and download prior to adding the firmware onto the pico?

    • @mmshilleh
      @mmshilleh  7 місяців тому

      I appreciate your positive feedback; it is part of the reason that keeps me producing videos.
      To answer your question, no you do not make the lib folder prior, in fact you make it once you have the full setup. You can create a folder called "lib" in your project before you upload the project to the pico. You can add subfolders of libraries you download from GitHub into the lib folder. So if you want the bme280 library you would place it in the lib folder and then upload the project. If you are still having issues I will gladly make a follow up video for you because I am sure others may have the same concern. Thanks buddy.

    • @jbelmont72
      @jbelmont72 7 місяців тому +1

      Awesome response. I am working on learning the basics of git and maybe that will help me figure how to get the library from GitHub to a file in my folder that I can name "lib" but honestly, I don't see how to make the jump. A tutorial on the subject would be welcomed (even lovingly embraced).

    • @mmshilleh
      @mmshilleh  7 місяців тому

      I will work on that soon, good idea! And welcome to the programming world git was incredibly intimidating for me at first now I use it everyday like writing my name haha@@jbelmont72

  • @nickk48
    @nickk48 Рік тому +1

    I installed Pico-W-Go on VS Code, I have Python 3.9+ on my PC. I have microPython on my board and it works with Thonny. The issue now is, apparently there are several more extensions required to make this thing work. I don't know the equivalent of Command-Shift-P in Windows 11. Is this something that works within the environment of VS Code or is it installed like any other app? I don't show any connection or opportunity to connect in the lower right. I'm hoping that "Configure Project" thing might be the key to all this, but don't know how to run it.

    • @mmshilleh
      @mmshilleh  Рік тому

      The equivalent should be Control + Shift + P. This works within the environment of VSCode for sure. This is called the "Command Palette" in VSCode and it is a common thing to use in such an IDE. You can try to redownload the latest version of MicroPython and reboot it again. Let me know

  • @jazzmannorman
    @jazzmannorman 9 місяців тому +1

    Hi!
    Thanks for the tutorial. It was super easy to follow. Can I ask, is there any way to manage packages using micropico, akin to Tools --> Manage Packages in Thonny?
    Thanks again

    • @mmshilleh
      @mmshilleh  9 місяців тому

      Great question, there is not, if you want any libraries you would have to download the library folders for that project from Github and move them into the lib folder on your Pico. Either way, the library manager in Thonny was not very robust either. Hope that helps and do not forget to subscribe ;)

    • @jazzmannorman
      @jazzmannorman 9 місяців тому

      @@mmshilleh Ah that's a shame. Thanks anyway

  • @jimTal001
    @jimTal001 6 місяців тому +1

    Thank you for the great work. You stated that the main.py file located in the home directory of the pico needs to be edited for code to be persistent. How does one access the home folder on the pico? Thanks

    • @mmshilleh
      @mmshilleh  6 місяців тому

      Jim great question, sometimes I skim over details and I forget what people need.
      To access the home directory on the Pico W in VSCode you can just upload a regular Python file. If you start uploading folders that is when you start creating other directories. So in its base form, you are already uploading to the home directory on the Pico W using this plugin. My terminology may have confused you.
      Does this make sense?

  • @paul300
    @paul300 7 місяців тому +1

    Have you considered making an update of this video will all the new stuff you can now do with MicroPico and the remote filesystem kind of stuff

    • @mmshilleh
      @mmshilleh  7 місяців тому +1

      I will make a 2024 update video great idea!

  • @regariantaring9006
    @regariantaring9006 6 місяців тому +1

    anyone can tell me how to "upload" program to pico using this method?
    i already try the example code (blink led) and try to "Run current file on pico" --> it's work, but not permanent uploaded, when i try to "upload project to pico" ---> nothing happened, is there something wrong?

    • @mmshilleh
      @mmshilleh  6 місяців тому

      If you want to upload a whole project and run a file after upload, the code that you want to run has to be in the main.py file for the Pico W to know what code to execute upon booting up. VSCode plugin has its flaws indeed. Nothing is wrong, it is just the way the plugin works

  • @gautombose4172
    @gautombose4172 Рік тому +1

    Excellent Video. H. How do you single step and debug Pyton Code running in Pico using VSCode ?

    • @mmshilleh
      @mmshilleh  Рік тому

      Thank you Gautom. I believe you cannot step through code with this extension. If anyone wants to correct me if I am wrong. I would simply debug with the console logging (print statements)

  • @arturgomboc8188
    @arturgomboc8188 Місяць тому +1

    Nice work! Could you help me? Chinese calliper data reading pi pico micropyton is the few lines of code that do this! Unfortunately,
    I couldn't find a sample example of such a thing anywhere!

    • @mmshilleh
      @mmshilleh  Місяць тому

      I help people on projects but typically I charge a small consulting fee. You can see more on my link
      buymeacoffee.com/mmshilleh
      Let me know if interested :)

    • @arturgomboc8188
      @arturgomboc8188 Місяць тому

      @@mmshilleh Micropython, can you write my question? There is an arduino code in C++, you just have to write it in micropython!

  • @JoaoFerreira-ck2ru
    @JoaoFerreira-ck2ru 6 місяців тому +1

    hey great tutorial, but i am having an issue.
    everytime i write the code onto the pico trough REPL it all works fine on vsCode,
    but wheni try to write a .py file and try to run it on the pico i always get my pico disconnected and
    the error "Exception occured (maybe a connection loss)".
    does anyone know how to solve this
    I am on windows 10

    • @mmshilleh
      @mmshilleh  6 місяців тому

      Hey Joao, never seen that error. Do you get the same error in Thonny? You should try that first. If you do it could simply mean an issue in your wiring or Pico. Sorry about that mate

    • @JoaoFerreira-ck2ru
      @JoaoFerreira-ck2ru 6 місяців тому

      Its all ok in thonny aswell as the pico i have tried in both picos i have and they work well with thonny, they both work well with repl in vscode but everytime i try to run the code on pico in vscode with micropico it disconnects

  • @Charlotte-jm2hj
    @Charlotte-jm2hj 6 місяців тому +1

    Can you with this plugging use Raspberry pi Pico to fake a mouseclicked ?

    • @mmshilleh
      @mmshilleh  6 місяців тому

      Hahahah I am sure you can there are examples of that online. Probably not something I would show on my channel mate :)

  • @SSidewaySS
    @SSidewaySS Рік тому +1

    I followed everything step by step but when I try to configure the Pico W it says "Activating Extensions..." on the bottom but then nothing happens. What can I do?

    • @mmshilleh
      @mmshilleh  Рік тому +1

      Do you have Python 3.9 or above?

    • @SSidewaySS
      @SSidewaySS Рік тому +1

      @@mmshilleh Yes, I have 3.11.4

    • @Dylanos
      @Dylanos 11 місяців тому +1

      Same issue here. Trying to find a solution.. Setting the path manually in the settings doesn't seem to make a difference.

  • @OrangesLmao
    @OrangesLmao Рік тому +1

    Can this tutorial also be used to code a normal raspberry pi pico?

  • @jimTal001
    @jimTal001 6 місяців тому +1

    I was able to simply save a main.py file to the pico and it runs automatically now. Thanks

    • @mmshilleh
      @mmshilleh  6 місяців тому

      That is great news, hope you can stay tuned to the future content!

  • @mathiskumar1472
    @mathiskumar1472 11 місяців тому +1

    How to connect raspberry pi pico w to (bluetooth camera or wifi camera)

    • @mmshilleh
      @mmshilleh  11 місяців тому +1

      Will consider this for sure!

    • @mathiskumar1472
      @mathiskumar1472 11 місяців тому

      I am waiting for video

    • @mathiskumar1472
      @mathiskumar1472 11 місяців тому +1

      Need for college project, so u post video this week my team move forward easily, next month sem exam also

    • @mmshilleh
      @mmshilleh  11 місяців тому +1

      Hello Mathis,
      I have not yet to order the camera to do this yet. Sorry about your deadline but even if I ordered it right now I would not have time to construct the video and post it in time!

  • @lithiraaponsu6063
    @lithiraaponsu6063 Рік тому +1

    with new 3.0 update, this didn't work to me. Any solution?

    • @mmshilleh
      @mmshilleh  Рік тому +1

      Is there an error message? What is the exact issue?

    • @nickk48
      @nickk48 Рік тому

      Thanks for the quick demo. I’m going to try it again after no luck the first time. But … an 85 MB text editor without a bookmark function?

    • @danesparza77
      @danesparza77 11 місяців тому

      @@nickk48 A bit more context about a bookmark function would be useful. As a developer of 25+ years (who has worked with 10+ languages) I have no idea what you're talking about.

    • @nickk48
      @nickk48 11 місяців тому

      @@danesparza77 OK. Some program text editors have a bookmark function which is handy for jumping between different spots in the file. I've been using Notepad++ which uses control-F2 to toggle a bookmark at the cursor location and F2 to go to the next bookmark, etc. I see that Microsoft Word also has a bookmark function, although I wouldn't use it for a program text editor. Congratulations on your 25+ years in software development and 10+ languages mastered.

  • @thespacecowboy420
    @thespacecowboy420 7 місяців тому

    how to upload?? why it doesn't start itself???

    • @mmshilleh
      @mmshilleh  7 місяців тому

      Can start itself if you upload it to main.py

    • @thespacecowboy420
      @thespacecowboy420 7 місяців тому +1

      I got it now of course it does but not when connected, thank you @@mmshilleh

    • @mmshilleh
      @mmshilleh  7 місяців тому

      @@thespacecowboy420 happy it works hope you can subscribe always willing to help!

  • @-blackcat-4749
    @-blackcat-4749 Рік тому +1

    Each 📖 act is ordinary. This took place

    • @mmshilleh
      @mmshilleh  Рік тому

      Not sure to be honest. I do not have that folder on my version. What are the sub-directories? Have you looked inside deeply?

    • @paul300
      @paul300 7 місяців тому

      It's the remote workspace showing you the files that are on your Pico. I guess you can work in this folder like normally but it directly saves your stuff on the Pico