Skip to content

PacktPublishing/MicroPython-Cookbook

Repository files navigation

MicroPython Cookbook

MicroPython Cookbook

This is the code repository for MicroPython Cookbook, published by Packt.

Build practical solutions to control LEDs, make music and read sensor data using popular microcontrollers such as Adafruit Circuit Playground, ESP8266, and the BBC Micro Bit

What is this book about?

MicroPython is an open source implementation of Python 3 that runs in embedded environments. With MicroPython, you can write clean and simple Python code to control hardware instead of using complex low-level languages such as C and C++. This book guides you through all the major applications of the MicroPython platform to build and program projects that use microcontrollers.

This book covers the following exciting features:

  • Execute code without any need for compiling or uploading using REPL (read-evaluate-print-loop)
  • Program and control LED matrix and NeoPixel drivers to display patterns and colors
  • Build projects that make use of light, temperature, and touch sensors
  • Configure devices to create Wi-Fi access points and use network modules to scan and connect to existing networks
  • Use Pulse Width Modulation to control DC motors and servos
  • Build an IoT device to display live weather data from the internet at the touch of a button

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter01.

The code will look like the following:

from adafruit_circuitplayground.express import cpx
import time

cpx.pixels[0] = (255, 0, 0) # set first NeoPixel to the color red
time.sleep(60)

Following is what you need for this book: This book aims to help people apply the power and ease of use of the Python language to the versatility of microcontrollers. Prior knowledge of Python is expected in order to understand this book.

With the following software and hardware list you can run all code files present in the book (All chapters).

Software and Hardware List

Chapter Software required OS required
All Mu Text Editor 1.x Windows, Linux, or macOS
All Screen terminal emulator Windows, Linux, or macOS

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Related products

Get to Know the Author

Marwan Alsabbagh has been coding in some form or other since before the web existed and has continued to develop software, with a particular passion for Python, his preferred programming language, for over a decade. He has been a speaker at a number of global Python conferences, where he has been known to present microcontroller projects with a healthy dose of humor and stage theatrics. The snow globe intruder alert system, which he created with his creative and curious daughters, was one of his favorite MicroPython projects. His research interests include software engineering, microcontrollers, and 3D printing.

Suggestions and Feedback

Click here if you have any feedback or suggestions.

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781838649951

About

MicroPython Cookbook, published by Packt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages