How to Use VSCode with Raspberry Pi Pico W and MicroPython

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] what's up YouTube in this video I'll be showing you how to start coding on your Raspberry Pi Pico W using visual studio code now this is sometimes preferred to using thiny IDE because in Visual Studio code as you know first of all it looks nicer and second of all you have many extensions and piloting tools that can help you write python code so enough being said let's get into it I'm going to imagine you already have Visual Studio code installed I'm using a Mac right now but if you're using Windows the process should be the same thing so I already have installed the installation for use code is beyond the scope of this video so I'm just going to assume that's already done and taken care of now once you have that I'm going to assume you also have your Raspberry Pi Pico or Pico W and now before you plug your Raspberry Pi Pico W in what you want to do is you're going to want to hold the boot cell button which is the only button on the Raspberry Pi Pica or pow which is that button right there and you want to hold it and plug it in at the same time into your computer so you install micropython onto the device so I'm holding it and once that happens if I go to my desktop you can see I have rp1 our rp2 so that means I did that correctly now we want to go and get the latest version of the micro python that we want to run on the Raspberry Pi Pico so I am just going to go to micropython.org and I'm just going to go to download and I selected Pico W because I'm using the Pico W version and you can just select the latest build from the nightly builds I just did this one it is April 7th as of the time of this video that I'm creating so I did that and I already downloaded as you can see I have it here so now I just want to move that on to the device so it's really simple you just want to go to your the object you downloaded the uf2 file and I could just drag it onto the device and we'll give that a moment there but we should see that the device will restart so let me exit the sounds okay okay now you know once that disappeared that you did everything correctly so I'm just going to go ahead and plug it back in so I'm going to go unplug and plug this time you don't have to hold the boot sell button the boot cell buttons only if you want to install the driver for micropython so go ahead and unplug and unplug the picot now once you have an unplugged unplugged and you have micropython installed now you want to go back to visual studio code so I'm going to go back here let me move my head and I'm just going to go to extensions and search Pico in the extensions and Pico wgo previously it was called picogo but now it's called Pico W go I think after the Pico W came out so let's go ahead and install that so we can see that it's installing and it does have some basic instructions here they're not that in depth one of the important things you want to know in the instructions is it does have some requirements so micro python firmware so we did that of course and the other one is python 3.9 or newer on your system I have python 3.11 if you're watching this video you should be past python 3.9 by now if not please upgrade because there are many benefits of going to python 3.11. so once you have that especially telling you how to set this up so we want to go to a project folder so we can just go to any folder on our device I'm just going to go to the Explorer I created a test folder on my desktop and what it's saying is hold command shift p so I'm on a Mac and then click click Pico W configure project so it's going to configure the Pico W extension into your project so if we go back to the Explorer we can see that in our test file we have this these files for the Pico W go now next thing if we want to start writing code on the Raspberry Pi Pico W what we can do is go down here on this Pico WC currently it's disconnected if we just click this we can see it finds it and connects it very easily and we could start writing code very simply so I'm just going to go ahead and do a file called test.pi and we can go ahead and enter that and I'm just going to use the code sample from from their example so if we go back here I'll show you that example in a sec to search Pico and we go here they have a very simple code sample I'm just going to scroll down let me exit all this and it's just the blink LED so if we go here and we copy this guy I'm going to go back to our files and we save it and we kind of Simply run that on our device and we should see the LED start blinking on our Raspberry Pi Pico W so if I go and say run current file now off the screen actually I could just show you that my device is blinking as yours should as well if you installed micro python correctly and you have a library installed correctly now you may be wondering if you have a usani ideb4 usually it does show your files on your Raspberry Pi Pico and your local files on your device I don't think it does that with this package which is kind of one of the cons but one of the pros of using this package is clearly we get to use a nice IDE which is much nicer than thoni and if you do want to deal with moving files back and forth from your Raspberry Pi Pico W they have a lot of commands that make it really really easy to do that so if we go here and we go to Pico w we can see all the commands so we can actually download all the files from our Raspberry Pi picow we can upload the whole project here to Raspberry Pi Pico W so really shouldn't be that different in dealing with files on your Raspberry Pi pqw you just don't have the nice selection as you had here on the side with finding ID but overall I think this is much more powerful and much nicer to work with when you are writing python so I think it's worth giving a shot and see how you like it and finally the last thing you could do which I think is pretty cool is you can actually go here and see the Pico pin map which is really convenient because sometimes I do forget the pins and which ones are rich when I'm putting sensors onto my device so this could be really useful for you as well so I think overall this is a pretty powerful extension vs code and I think you should try using it so if you like something in this video please like comment and subscribe to the channel if you have any questions about what I did in this video let me know in the comment section down below and as always guys stay tuned and thanks for watching [Music]
Info
Channel: Shilleh
Views: 45,945
Rating: undefined out of 5
Keywords: visual studio code raspberry pi pico w, vscode raspberry pi pico w, pico-go vscode, pico-w-go vscode, micropython vscode pico w, micropython, vscode, raspberry pi pico vscode, raspberry pi pico w vscode, micropython visual studio code
Id: O6lkYTfcMEg
Channel Id: undefined
Length: 6min 14sec (374 seconds)
Published: Sun Apr 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.