The Raspberry Pi Pico

The Raspberry Pi Pico

The Raspberry Pi foundation changed single-board computing when they released the Raspberry Pi computer, now they’re ready to do the same for microcontrollers with the release of the brand-new Raspberry Pi Pico.

But wait

Microcontroller and single board computers what are they? Are they any different?

Let’s clarify that first.

The computer runs on operating systems and designed to complete multiple tasks at the same time. While on the other hand, Microcontrollers are a different type of device than Single Board Computers (like the Raspberry Pi 4 and previous generations of Pi), they don’t run an operating system and they are typically programmed to do just one task – though that task can be pretty intricate and exciting! They’re perfect for experimenting with hardware and using it as the brains of custom devices, machines, and inventions.

Examples of Single Board computers are Nvidia Jetson, Raspberry pi etc

And Microcontrollers includes our lovely Arduino, ESP8266, ESP32, STM32 and a new name in this list The Raspberry Pi Pico.

Now the question arises… when we already have a lot of microcontroller boards why we need a new one? And how is it different from Arduino? And should we consider buying it?

Technology changes every day, every new year we get new and faster iPhones and the Arduino UNO R3 which most enthusiasts use released in 2010. We are using a 11-year-old technology.

The Pico is faster than Arduino. As it has faster clock, more memory, more data lanes and capable of handling two tasks at a time using its Dual Cores. It can be programmed with C++ as well as MicroPython.

Pico comes at a small price of 400 rupees only. So, you should definitely buy it.

In this video series we are going to learn how to use a Pico step by step.

This is first video of this series and we will learn

  1. Installing Firmware in Pico
  2. Setting up VS Code
  3. Writing Code for Blinking LED

Firstly, we have to download MicroPython firmware for Pico.

  1. Open the link in description and go to getting started with MicroPython and download the uf2 file
  2. Take a data cable and connect Pico to your computer but before connecting press the bootsel button on Pico
  3. A window will open. Copy the uf2 file to this folder
  4. and firmware installation is done.

Now we will setup vs code. You may have watched my previous video on how to setup vs code for Arduino. You can check it out from link in description.

  1. Open vs code and go to extensions
  2.  Search for Pico and install the Pico go extension
  3. Now we have to install NodeJS and python… using links in description download and install python and NodeJS
  4. Automatically vs code will give you advise to install python extension … install it also.

Now our setup is done… we are ready to rock

But before that let’s hear a word from sponsors of this video.

Let’s program the Pico

  1. Close vs code and make a new folder… let’s name it as Pico … now create a new folder with name first project.
  2. Right click and click on open with code
  3. Vs code will open.
  4. Now press control shift + p and search for Pico and select configure project
  5. Now a .vscode folder will appear in explorer
  6. Let’s connect the Pico with cable to our computer
  7. You will see connected to COM port in terminal means Pico is connected
  8. Create a new file flash.py
  9. And write code here …
from machine import Pin
import time

pin = Pin(25, Pin.OUT)  

while True:             
    pin.toggle()
    time.sleep_ms(1500)
    pin.toggle()
    time.sleep_ms(500)

First line imports pins

Then we will import time for creating delay

Then we will set our pin as output… built-in led is connected to pin 25 on Pico

Then we will create an infinite loop where we use pin.toggle to change led state and give delay in between

  1. Then we will click on run to run the code
  2. Now you will see led starts to blink
  3. Now we can try changing delay to change blink timing.

MicroPython is really an easy language to learn and there are lots of libraries which we can use to program our microcontrollers.

In the next tutorials we will check out PWM pins of Pico.

So that was it for this video. If you like this video give this video a thumbs up share with your friends and don’t forget to subscribe.

Thank you for watching and have a nice day.

Leave a Reply