Raspberry Pi Pico W LED Blink
by Ramatronics Laboratory in Circuits > Microcontrollers
12594 Views, 4 Favorites, 0 Comments
Raspberry Pi Pico W LED Blink
INTRODUCTION:
In my previous instructables, I showed you step by step how you can download the micro python firmware for raspberry pi pico w and upload it on the raspberry pi pico w. Now In this instructables, I am going to show you how we can blink the on board LED of the raspberry pi pico w board. I will also connect an external LED to the raspberry pi pico w and and blink it. This instructables is suitable for beginners who want to start programming with raspberry pi pico w. So let's get started.
Supplies
Hardware Requirements:
https://quartzcomponents.com?sca_ref=3671286.DzEptz4I3w
Raspberry Pi Pico W
https://quartzcomponents.com/products/raspberry-pi-pico-w?_pos=1&_sid=726851df3&_ss=r
Bread board
LED(color = red, size = 5mm)
https://quartzcomponents.com/products/red-5mm-led?_pos=1&_sid=d50f3cd19&_ss=r
Jumper wires(male-to-male)
https://quartzcomponents.com/products/65pcs-breadboard-jumper-cable?_pos=7&_sid=6ed0cd1a2&_ss=r
Resistor(330 Ohm, 1/4W)
Raspberry Pi Pico W
Bread board
LED(color = red, size = 5mm)
Jumper wires(male-to-male)
Resistor(330 Ohm, 1/4W)
Raspberry pi pico W
https://robu.in/product/raspberry-pi-pico-w/
Bread board
https://robu.in/product/mb102-830-points-solderless-prototype-pcb-breadboard-high-quality/
Micro USB Cable
https://robu.in/product/50-cm-micro-usb-cable/
Male headers
https://robu.in/product/2-54mm-1x40-pin-male-single-row-straight-short-header-strip-pack-of-3/
Software Requirements:
Thonny(Micro Python IDE for Beginners).
Downloading the Firmware and Installing It on Pico W
If you have purchased a new raspberry pi pico w board, first of all you need to download the latest version of micro python firmware for your raspberry pi pico w board and install it on your pico w. I have already published an another instructables on raspberry pi pico w in which I have explained in detail how to do this. I highly recommend to read that instructables. The link of the instructables is as following:
Writing a Micro Python Program to Blink the on Board LED
Open a new script in thonny IDE and write the following lines of the micro python program and save the script on your pico w board with file name as main.py.
import machine
import time
led = machine.Pin('LED', machine.Pin.OUT) #configure LED Pin as an output pin and create and led object for Pin class
while True:
led.value(True) #turn on the LED
time.sleep(1) #wait for one second
led.value(False) #turn off the LED
time.sleep(1) #wait for one second
After saving the main.py, click on run option.
Making a Prototype Circuit on the Bread Board
Write a Micro Python Program to Blink External LED
Open a new script in thonny IDE and write the following lines of the micro python program and save the script on your pico w board with file name as main.py.
or
You can just replace the number 15 by string 'LED' in main.py script that you have written in step 2.
import machine
import time
led = machine.Pin(15, machine.Pin.OUT) #configure GPIO-15 Pin as an output pin and create and led object for Pin class
while True:
led.value(True) #turn on the LED
time.sleep(1) #wait for one second
led.value(False) #turn off the LED
time.sleep(1) #wait for one second
After saving the main.py, click on run option.