Book Image

MicroPython Projects

By : Jacob Beningo
Book Image

MicroPython Projects

By: Jacob Beningo

Overview of this book

With the increasing complexity of embedded systems seen over the past few years, developers are looking for ways to manage them easily by solving problems without spending a lot of time on finding supported peripherals. MicroPython is an efficient and lean implementation of the Python 3 programming language, which is optimized to run on microcontrollers. MicroPython Projects will guide you in building and managing your embedded systems with ease. This book is a comprehensive project-based guide that will help you build a wide range of projects and give you the confidence to design complex projects spanning new areas of technology such as electronic applications, automation devices, and IoT applications. While building seven engaging projects, you'll learn how to enable devices to communicate with each other, access and control devices over a TCP/IP socket, and store and retrieve data. The complexity will increase progressively as you work on different projects, covering areas such as driver design, sensor interfacing, and MicroPython kernel customization. By the end of this MicroPython book, you'll be able to develop industry-standard embedded systems and keep up with the evolution of the Internet of Things.
Table of Contents (14 chapters)
11
Downloading and Running MicroPython Code

Testing the gesture controller

The code for this project can again be found at https://github.com/PacktPublishing/MicroPython-Projects/tree/master/ch7.

Download the code and then copy it to your development board. If you aren't using an STM32L475 IoT Discovery node, you may need to modify the LED pins or the I2C bus you are using, but otherwise, the application should run without any other issues.

Once the application and the APDS-9660 module are copied to your MicroPython board, in the REPL, press Ctrl + D. This will perform a soft reboot and start the application. You can now present the APDS-9660 with a gesture. If you swipe right, you should see Right! in the REPL, along with one of your LEDs turning on. If you swipe left, you'll see Left! and the LED associated with it will turn on. The LEDs should turn off within 5 seconds. If you find this is too long, change...