Table of Contents
Jointly authored by Harry Fairhead and Mike James, it takes you though possible uses of the Pico, which can be used for reading sensors, connecting to networks or driving actuators, and such like. Chapters cover using GPIO, simple outputs, events and interrupts, pulse width modulation, the SPI bus, the PIO, the serial port, and more…
And why MicroPython? The authors say it is a good choice of language to program the Pico as it’s based on Python 3, and is fully object-oriented, which means that you can create classes to encapsulate hardware and make it easier to use and understand. Ah, encapsulation. I remember that. And inheritance…
The publishers write:
“The purpose of Programming the Raspberry Pi Pico in MicroPython is to reveal what you can do with the Pico’s GPIO lines together with widely used sensors, servos and motors and ADCs. After covering the GPIO, outputs and inputs, events and interrupts, it gives you hands-on experience of PWM (Pulse Width Modulation), the SPI bus, the I2C bus and the 1-Wire bus.”
“One of the key advantages of the Pico is its PIO (Programmable I/O) and while this is an advanced feature it is included in this book. After finding out how the PIO works, we apply it to writing a PIO program for the DHT22 and the 1-Wire bus.”
Building on Raspberry Pi’s microcontroller-class product – the RP2040 – the Raspberry Pi Pico was realeased in January 2021. A compatible version of MicroPython was realeased for it, too, separately.
The Pi Pico serves as a standalone board option for embedded development or as companion piece to your Raspberry Pi computer, perhaps serving first steps with a microcontroller.
Basically, we are talking about interfacing your Raspberry Pi to the outside “real” world. It’s priced at $4.
Programming the Raspberry Pi Pico in MicroPython details
Title: Programming the Raspberry Pi Pico in MicroPython
Author: Harry Fairhead, Mike James
Publisher: I/O Press
Date: May 2021
Harry Fairhead is also the author of Raspberry Pi IoT In C Using Linux Drivers, Raspberry Pi IoT in C, Second Edition Micro:bit IoT in C, Second Edition Applying C For The IoT With Linux and Fundamental C: Getting Closer To The Machine.
Mike James is the author of Programmer’s Python: Everything is an Object and other programming and computer science titles in the I Programmer Library.
As with their previous collaboration, Raspberry Pi IoT In Python Using Linux Drivers, Harry brings his expertise in electronics and the IoT while Mike contributes the Python code.