Introduction to MicroPython
This lesson assumes that you have at least skimmed the Getting Started sections and have selected one of the MicroPython IDEs to write your code.
The lesson will introduce you to the basic concepts of using MicroPython using the $4 Raspberry Pi Pico or a similar microcontroller.
The first two examples just use the Raspberry Pi Pico and don't require a breadboard or wiring. All the subsequent examples will require you to place components on a solderless breadboard.
Basic Examples
- Blink the Onboard LED — Make the green LED on the Pico blink on and off every half second using just a USB cable and no extra parts.
- Internal Temperature Sensor — Read the Pico's built-in temperature sensor and print Celsius and Fahrenheit values to the console.
- Button — Wire a momentary push button to the Pico and use it to toggle the built-in LED on and off.
- Potentiometer — Turn a knob to control the blink speed of an LED, introducing analog-to-digital conversion.
- Fade In and Out — Use Pulse Width Modulation (PWM) to smoothly dim an LED to any brightness level.
- Motor — Drive a small DC motor using a transistor or motor driver chip to handle the extra current a motor needs.
- Servo — Control a servo motor with PWM signals to move it to a precise angle and hold it there.
- NeoPixels — Program colorful RGB NeoPixel LEDs using MicroPython's built-in NeoPixel library.
- Wireless — Connect a Raspberry Pi Pico W to a WiFi network and explore basic wireless communication.
- Configuration File — Store pin numbers in a single config file so all your example programs work without editing each one separately.