pololu / zumo-2040-robot

Example code for the Pololu Zumo 2040 Robot
MIT License
0 stars 2 forks source link

How to use Visual Studio Code with the Zumo 2040 #1

Open jcocovich opened 9 months ago

jcocovich commented 9 months ago

I am attempting to run main.py in Visual Studio Code and it complains about no such module 'machine'. What's up?

pdg137 commented 9 months ago

Hello,

It sounds like you are running it in Python on your computer instead of running it in MicroPython on the Zumo. (Python does not have a "machine" package.) While VS Code can certainly edit files on the Zumo, to run code interactively or access the REPL you will need some kind of extension.

There are various extensions designed to connect Visual Studio Code to a Raspberry Pi Pico, and since the Zumo is mostly Pico-compatible, any of them would likely work. However we don't have any experience with them and I'm not sure which ones are currently maintained.

There are various possible points of confusion like USB IDs and different methods for accessing files on the board, so I recommend getting started with Thonny and moving to VS Code only once you are very comfortable with it. If you find an extension that works well with the Zumo, could you share it here?