Getting started with Raspberry pi pico and controlling it with micropython (windows users)

 Raspberry pi

The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. It is a capable little device that enables people of all ages to explore computing, and to learn how to program in languages like Scratch and Python.










                                                             Raspberry pi Pico

Raspberry Pi Pico is micro-controller board powered by a powerful Raspberry Pi designed dual core ARM Cortex M0+ Processor and has 256KB RAM and 2MB Flash.


Well that sums up the concept of Raspberry pi pico.
Let's get started with the main steps.

Pico comes blank it's up to us whether to program it with c,c++ sdk or micropython sdk. In this blog I will be covering the pico with  micropython.
There are certain steps that we have to keep in mind in order to setup python sdk on our Raspberry pi pico.
1. We have to download the .uf2 file from the official website.
2. Now , we have to connect the board in the storage media format to do that just hold the BOOTSEL button on your board and then connect to your PC using usb cable.
after that is done you will see your pico is mounted as mass storage with 127 mb of space namely as "RPI-RP2".


CAUTION:- Don't open this device .
3. Now just drag and drop .uf2 file in the mass storage.

Voila! Now , your board can successfully run micropython.

NOTE:- After you drag and dropped the .uf2 file it will automatically flash it and you won't be able to see Pico as storage media.

Now, let's check whether we can successfully interact with board using micropython or not?

1. Download Putty which will act as REPL terminal program for us.

2. Fire up putty terminal.

You will get such interface just change the connection type to Serial.

3. Now you will get this interface , change the port to the port where your Pico is connected and click on open.






After getting to this don't worry if your screen is black it can still execute micropython syntaxes.

4. Let's run some line of code on this python interpreter and we will try to toggle the LED connected on Pin 25 of our pico board.

from machine import Pin
led_pin = Pin(25,Pin.OUT)
led_pin.toggle()
print("hello world!")

execute these three line of code line by line if it changes the state of your led and prints the "hello world!" then you have successfully setup the micropython on your raspberry pi pico.

In upcoming blogs I will tell you how to use thonny with pico. STAY TUNED!!

Facing troubles?

Comment down or you can contact me at :-
E-mail - shikharsinha34920@gmail.com
LinkedIn - https://www.linkedin.com/in/shikhar-kant-sinha-2b9179197/
 




Comments

Popular posts from this blog

Getting started with thonny and raspberry pi pico

Micropython with python 3.8 and esp8266

How to reset NodeMCU from MicroPython to Embedded C(Arduino Console)