MPRemote
Install mpremote and you are able to send code direct to the Pico and run it
apt install mpremote mpremote fs cp main.py : mpremote run main.py
An Exmaple main.py is below. This is the beginner LED Blink circuit. For a Pi - PicoW 2 its good to use "LED" as the default onboard LED
vi main.py
from machine import Pin
import time
# Initialize the onboard LED pin (GPIO 25)
led = Pin("LED", Pin.OUT)
print("Pico 2 testing started! Press Ctrl+C in the shell to stop.")
# Run an infinite loop to blink the LED
while True:
led.value(1) # Turn the LED on
time.sleep(0.5) # Wait 0.5 seconds
led.value(0) # Turn the LED off
time.sleep(0.5) # Wait 0.5 seconds
To add more complex work you create the main.py or libs and
mpremote fs cp main.py :
The new file or script