Skip to content

asathiskumar98-byte/Raspberry-Pi-Pico-W-LED-Control-with-Button-MicroPython-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”˜ Raspberry Pi Pico W – LED Control with Button (MicroPython)

This project turns an LED ON when a button is pressed and OFF when released using MicroPython on the Raspberry Pi Pico W.


🧰 Requirements

  • Raspberry Pi Pico W
  • MicroPython firmware installed
  • Thonny IDE
  • Push button + Jumper wires

βš™οΈ Pin Configuration

Component Pin Mode
Onboard LED "LED" OUTPUT
Button GPIO16 INPUT (PULL-UP)

πŸš€ Run the Code

  1. Open Thonny IDE
  2. Choose Interpreter β†’ MicroPython (Raspberry Pi Pico)
  3. Connect Pico W via USB
  4. Copy and save code as main.py
  5. Press the button and watch the LED respond instantly πŸ”†

🧩 Concept

The button input uses a pull-up resistor, keeping it HIGH until pressed.
When pressed β†’ logic LOW β†’ LED turns ON.
When released β†’ logic HIGH β†’ LED turns OFF.


πŸ”§ Try These Next

  • Add debounce delay: time.sleep(0.05)
  • Toggle LED on press (instead of hold)
  • Use Wi-Fi to control LED via button press status

About

This project turns an LED ON when a button is pressed and OFF when released using **MicroPython** on the **Raspberry Pi Pico W**.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages