Micro Python - Blink LED

Raspberry Pi Pico
Below is the code required to blink an LED in micro python.


Both wireless and none wireless examples are provided below.


Tested on a Raspberry Pi Pico W.






MICRO PYTHON CODE (Wireless):

import machine

import time

# Set the pin that the onboard LED is connected to

pin = machine.Pin("LED", machine.Pin.OUT)

# Create an infinite loop that toggles the state of the LED every second

while True:

  pin.on()

  time.sleep(0.5)

  pin.off()

  time.sleep(0.5)

MICRO PYTHON CODE (Not Wireless):

import machine

import time


# Set the pin that the onboard LED is connected to

pin = machine.Pin(25, machine.Pin.OUT)


# Create an infinite loop that toggles the state of the LED every second

while True:

  pin.on()

  time.sleep(0.5)

  pin.off()

  time.sleep(0.5)

Popular posts from this blog

Review - E-Yooso Z-88 Keyboard

Replacing Viking GB455 Mulcher Blades