EMBEDDED PROGRAMMING

GROUP ASSIGNMENT

Group assignment was all about exploring different toolchains.

GETTING STARTED WITH RASPBERRY PI PICO W

For getting started with Raspberry Pi I visited site, to try to learn its basics.

Below is the Raspberry Pi Pico Pinout.

pinout

GETTING STARTED WITH MICROPYTHON

To be able to work with Pi, I had to choose the programming launguage to use, which I went with MicroPython. MicroPython is a lean and efficient implementation of the Python 3 programming launguage that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments. MicroPython is packed with full of advanced features such as an interactive prompt, arbitrary precision integers, closures, list comprehensions, generators, exception handling and more.

HOW TO USE MICROPYTHON

I started off by downloading Thonny program from the website

thonny

I then installed the program and launched it.

thonnyinstall thonnylaunch

After launching it I configured the interpreter, choosing MicroPython (Raspberry Pi Pico) as the launguage that will be used to run the my code. And then I installed MicroPython.

thonnyconfigure micropythoninstall

Continuation of installing MicroPython

This is where I then brought in picture the Raspberry Pi Pico to use, which is shown in the picture below.

micropythoninstall

I then began with holding the BOOTSEL button on Pi Pico and then plugged the USB cord to get the options/variants to choose from depending on the Pi Pico I am using. After selecting it I then completed the installation.

micropythoninstall micropythoninstall

CODING WITH MICROPYTHON

LED LIGHTING

I began with the activity of coding for lighting an LED of which I thought was the easiest looking at the fact that it was my first time using MicroPython. After coding I ran the code by clicking the little green arrow on the program interface. And observed the outcome in the board.

coding

The LED began to light as the code was being ran.

ledlighting

INTRODUCTION OF POTENTIOMETER

I then introduced the code for controlling the brightness of the LED using a potentiometer, and then connected the potentiometer to the Pi Pico W and then ran the code.

INTRODUCTION OF A LIGHT DEPENDENT RESISTOR

To my code I then introduced a coding for a light dependant resistor, coding to send the reading of different light exposed to it. Using a connecting wire I connected the ldr to the Pi.

ldrcode ldrconnection