Authorized Online Retailers:

Buy from USA Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Buy from JP

Raspberry Pi Pico is a tiny, fast, and versatile board built using RP2040, a brand new microcontroller chip designed by Raspberry Pi in the UK.
Don’t be confused by the name Raspberry Pi Pico. It is quite different from other Raspberry Pi products such as Raspberry Pi 2, 3 and 4 pocket computers which have Linux OS.
Pico does not have any OS, it is actually a low-cost, high-performance micro-controller board with flexible digital interfaces.   In fact, Pico’s functions are more like its competitor Arduino MCU boards.

You can program Pico with C++ and MicroPython. In this tutorial, we focus on MicroPython which is more friendly to beginners.
Step 1  Download and install MicroPython firmware to Pico board:

  1. Download the MicroPython UF2 file from following link:
    https://micropython.org/download/rp2-pico/rp2-pico-latest.uf2
  2. Push and hold the BOOTSEL button and plug your Pico into the USB port of your Raspberry Pi or other computer. Release the BOOTSEL button after your Pico is connected.
  3. It will mount as a Mass Storage Device called RPI-RP2.
  4. Drag and drop the MicroPython UF2 file onto the RPI-RP2 volume. Your Pico will reboot. You are now running MicroPython.

Step2 Download and Install Thonny Python IDE

  1. Download Thonny Python IDE for your PC from following link(make sure you select correct OS version for your PC):
  2. Run the installation software from the download file.
  3. Now open the Thonny Python IDE, click Run to select MicroPython for Rapsberry Pi Pico as Interpreter :

    Also please select the COM port which your Pico board is connected as photo.After that, click OK to save the setting.
  4.  copy following code and paste them to the coding window:
    from machine import Pin 
    from time import sleep
    led = Pin(25,Pin.OUT)
    n=0
    while True:
        led.toggle()
        print("counter is {}".format(n))
        n=n+1
        sleep(1)
    

    You will see the code in IDE as following

  5. Click the little ► button to run the Python code
  6. Click File ->Save As
    Then select Raspberry Pi Pico as destination
  7. Name the file as main.py, then click OK

Now  the main.py code will automatically run when Pico board is connected to USB power.
Remember, only main.py can be automatically executed. If your python code is saved to other name, it can not be executed automatically.

You will see the LED in Pico board will flash constantly.Congratulations! You have made your first Python program running in Pico!

(see the # comments in each line):

from machine import Pin #import machine library to control GPIO pins
from time import sleep #import time library to use sleep function
led = Pin(25,Pin.OUT) #Set Pin 25 in OUTPUT mode, Pin 25 is connected an internal LED integrated in the board
n=0 
while True:
    led.toggle() #make pin 25 led flash once 
    print("counter is {}".format(n)) # display flash counter in the terminal
    n=n+1
    sleep(1) #delay one second and do next flash

Learn More about parts SKU:2021005900

No. Picture Product Name Link
1 Raspberry Pi Pico Board https://osoyoo.store/products/raspberry-pi-pico-flexible-microcontroller-board-based-on-the-raspberry-pi-rp2040-dual-core-arm-cortex-m0-processor-1-pc?variant=39875307864175
2 Servo motor https://osoyoo.store/products/micro-servo-sg90-blue-for-arduino-v2-0-robot-carmodel-lacc200610?variant=31648847560815
3 Infrared Sensor Module https://osoyoo.store/products/hc-sr501-pir-motion-sensor-for-arduino?variant=31957812838511
4 RFID Module and card https://osoyoo.store/products/osoyoo-rfid-module?variant=31970646130799
5 Push Buttons and Hats https://osoyoo.store/products/push-button-and-hats-5pcs?variant=39879253131375
6 LED(6 x White, 6 x Red, 6 x Yellow, 6x Green) https://osoyoo.store/products/led-packs-for-arduino?variant=31957816442991
7 Servo motor https://osoyoo.store/products/sg90-micro-servo-for-arduino-raspberry-pi-robot?variant=31957821096047
8 Piezo Buzzer Module https://osoyoo.store/products/piezo-buzzer-module-1pcs?variant=39879251656815
9 I2C LCD Display(16×2) https://osoyoo.store/products/i2c-lcd1602-display?variant=39875437101167
10 Philips Screwdriver https://osoyoo.store/products/phillips-screwdriver?variant=31930635780207https://osoyoo.store/products/single-channel-relay-module-for-arduino-raspberry-pi?variant=31955954401391
11 Solderless Prototype Breadboard https://osoyoo.store/products/solderless-prototype-breadboard-1pcs?variant=39879255457903
12 Potentionmeter (10K adjustable resistor) https://osoyoo.store/products/potentionmeter-10k-adjustable-resistor-3pcs?variant=39879281016943
13 40Pin M to M Jumper Wires https://osoyoo.store/products/40pin-m-to-m-jumper-wires?variant=39879256539247
14 20Pin M to F Jumper wires 15cm https://osoyoo.store/products/20pin-15cm-female-to-female-cable?variant=31930663305327