Panel Cookies
Raspberry Pico Permanent code
13/02/2021 | Views: 12807 | Arduino | by: ELECTRONOOBS      


But wait a minute. If I disconnect the USB cable and plug it back in, as you can see in the video below, the LED is not blinking anymore. Well that’s because we were running the py code from our PC. If you want the code to automatically run when you power the raspberry PICO, you need to add that code to the microcontroller.





Creating main.py


Here’s how we make the code run automatically from the pi. Create a new file in thonny. Click save and here, select to save it to the raspberry pico. Now is important to name this file main.py. If you give it a different name, it won’t run automatically. The Pi is always looking for a main dot pi file. Add your code inside this file. Now, when you click the save button, the changes are saved to the main.py file that’s on the microcontroller memory. As you can see below, the LED is blinking. I remove the USB cable and connect it back on. And there you go, the LED is blinking automatically without me running it from the PC. Nice!


micropython permanent code






13/02/2021 | Views: 12807 | Arduino | by: ELECTRONOOBS      












Last tutorials

All about Arduino PWM frequencies
10 Stage Coilgun - Version 2
Tesla Coil on PCB
RLC Transistor Tester PCB with Arduino
Ferrofluid 3D printed Bluetooth Speaker

ADVERTISERS



Affiliate Disclosure

ADVERTISERS



PCBWAY PCB service





Curso Arduino Online nivel bajo