Raspberry Pico Permanent code
13/02/2021 | Views: 3467 | 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: 3467 | Arduino | by: ELECTRONOOBS      












Last tutorials

Homemade Balanced BMS circuit - Current Limi
STM32 Development board PCB
STM32 + NRF24 radio module
Starting with STM32 and the Arduino IDE
Analog Video Transmitter Circuit

ADVERTISERS



ADVERTISERS

PCBWAY PCB service

PCBWAY PCB service





Curso Arduino Online nivel Intermedio