0

When I run my code to blink a LED, Thonny runs it well. But on the Raspberry Pi Pico itself the LED is not blinking:

from machine import Pin
from time import sleep

led = Pin(25, Pin.OUT)

while True:
    led.toggle()
    sleep(0.1)

I tried resetting the whole board.

user4157124
  • 2,809
  • 13
  • 27
  • 42
An0nymous
  • 16
  • 1

1 Answers1

0

Just in case you run this code on a Raspberry Pi Pico W (with the WiFi module) you need to use

led = Pin('LED', Pin.OUT)

See MicroPython Forum Blink onboard LED