SINGLE LED BLINK
π‘ LED Interface with RP2040 β Short Note
Overview:
An LED (Light Emitting Diode) is a basic output device used with RP2040 to visually indicate status, signals, or logic. It glows when current flows through it in the forward direction.
βοΈ Required Components:
R2040 (or any board)
LED (any color)
220Ξ© resistor (to limit current)
Breadboard and jumper wires
π Circuit Diagram:
π Notes:
Pin(2, Pin.OUT)
sets GPIO2 as an output pin.led.toggle()
is a convenient way to flip the state without checking it first.You can replace
2
with any valid GPIO pin like3
,15
, etc., depending on your wiring.
β Wokwi Setup Steps
Go to Wokwi: https://wokwi.com
Click “New Project” β Select Raspberry Pi Pico (Python)
π Connect LED in Simulator
In Wokwi circuit editor, connect as follows:
GPIO2 β Anode (+) of LED (with 220Ξ© resistor)
Cathode (β) of LED β GND
π οΈ Customizing the Simulation
If you’d like to modify the GPIO pin or adjust the blink interval:
Click the “Edit Code” button in the simulation.
Change the
Pin(5, Pin.OUT)
line to use your desired GPIO pin (e.g.,Pin(2, Pin.OUT)
).Adjust the
sleep(0.5)
value to set a different blink interval (e.g.,sleep(1)
for a 1-second interval).Click the “Start Simulation” button to see the changes in action.
π SampleΒ Code:
π§ Key Points:
Always use a resistor to prevent LED damage.
led.toggle() turns ON the LED.
LEDs are polarity sensitive (must be connected the right way).
Multiple LEDs can be connected to different pins for patterns.
π For More Details & Project Support:
Power Integrated Solutions
Networks | Electronics | Home Automation | Water Automation | IoT | PLC | Embedded | DBMS
π Location:
10A/3, Radhakrishnan Colony,
Sasthri Road, Tennur,
Tiruchirappalli, Tamil Nadu β 620017
π View on Google Maps
π§ Email:
π± Phone / WhatsApp:
+91 76393 85448
+91 82488 85959
π Letβs Build the Future with Innovation in Education & Technology!