Master the Pi Pico GPIO
Get to grips with the Raspberry Pi Pico’s GPIO to open the gateway to a range of simple projects.
YOU NEED
» Raspberry Pi Pico or Pico W
» A push button
» An LED
» 330 Ohm resistor (orange-orange-brown-gold
» A breadboard
» Code: https:// github.com/ lesp/LXF-Pi-Special/ archive/refs/ heads/main. zip
»SD card
ThePi Pico comes pre-installed with MicroPython, a version of Python 3 for microcontrollers. It is regularly updated and new versions can be found at https://bit.ly/lxf298 upython. It is prudent to update MicroPython before trying this tutorial.
Our circuit for this project is a simple LED toggle switch – adetailed circuit diagram is included in the download link. A push button is used to turn the LED on and off. The Pico reads the GPIO pins and reacts to the change. Download and install Thonny for your OS and connect your Pico to the computer. Open Thonny, go to Tools > Options and click on the Interpreter tab. Set the interpreter to be MicroPython (Raspberry Pi Pico), then set the serial/ COM port to auto-detect the Pico. Thonny should now detect the Pico and the Python shell confirms this.