Python Tutorials – Lesson 1 – Single LED Blink Using Raspberry Pi Pico

To check single LED blink using Raspberry Pi Pico

Required Components

  1. Led _1 no
  2. Resister 330Ω _1 no
  3. Raspberry Pi Pico board _1 no
  4. Connecting wires _1 set

Circuit

Steps

  1. Make sure the components are working properly.
  2. Connect 330 Ω Resistor to the LED Anode (+) pin and LED cathode (-) pin to Gnd.
  3. Connect Raspberry Pi Pico pin 28 to the LED anode pin.
  4. Check the Python program.
  5. Check the circuit connections.
  6. Run the Python program.

Python Program

from machine import Pin
import utime  #timer

led1=Pin(2,Pin.OUT)

while(True):    
    led1.value(1)
    utime.sleep(2) #delay of 1 sec
    led1.value(0)
    utime.sleep(2)

Leave a Reply

Your email address will not be published. Required fields are marked *