#########################################
# LED Interfacing #
#########################################
#
# Interfacing LED to Raspberry Pi Pico and controlling it Using MicroPython (Hardware & Simulation)
#
# Check out the link for Code explanation and Hardware details
# Link:
# http://tech.arunkumarn.in/blogs/raspberry-pi-pico/interfacing-led-to-raspberry-pi-pico-and-controlling-it-using-micropython/
#
# Low Logic LED : ON for GPIO set to 0 : OFF for GPIO set to 1
# HIGH Logic LED : ON for GPIO set to 1 : OFF for GPIO set to 0
#
from machine import Pin
import time
# LED 1 connected to GPIO 3
led_1 = Pin(3, Pin.OUT)
# LED 2 connected to GPIO 12
led_2 = Pin(12, Pin.OUT)
while True:
# Turning ON LED
led_1.value(0)
led_2.value(1)
time.sleep_ms(1000)
# Turning OFF LED
led_1.value(1)
led_2.value(0)
time.sleep_ms(500)Low Logic
High Logic
LED 1
LED 2
R1
R2