Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • MicroPython Projects
  • Toc
  • feedback
MicroPython Projects

MicroPython Projects

By : Brad Stewart
4.4 (10)
close
MicroPython Projects

MicroPython Projects

4.4 (10)
By: Brad Stewart

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)
close
11
Downloading and Running MicroPython Code

To get the most out of this book

This book assumes that the reader has a basic understanding of Python and that they have at least built a few embedded systems projects previously. The material is written so that a beginner will not have any problems and a more experienced embedded software developer will be able to quickly learn how to write MicroPython-based applications. I also assume that you are able to read flowcharts and basic wiring diagrams. The reader should also understand how to use a Git repository and install software on their computer.

Software/hardware covered in the book

OS requirements

PyCharm

Windows, Linux, macOS

PuTTY

Windows, Linux, macOS

Linux Virtual Machine

Windows, Linux, macOS

Python 3.x

Windows, Linux, macOS

Anaconda Terminal

Windows, Linux, macOS

Simple TCP Socket Tester

Windows, Linux, macOS

OpenMV IDE

Windows, Linux, macOS

Pyboard

-

RobotDyn I2C 8-bit PCA8574 I/O expander

-

Adafruit RGB Pushbutton PN: 3423 or equivalent

-

STM32L4 IoT Discovery Node

-

Robotdyn I2C 8-bit PCA8574 I/O expander

-

USB to UART Converter

-

Adafruit ADPS9960 breakout board

-

MicroPython supported development board

-

ESP32 WROVER-B

-

OpenMV Camera Module

-

The projects are not necessarily designed to be done in order. With that in mind, I would recommend that developers read the first two chapters in order before jumping to the project that is most interesting to them. These chapters give the background on MicroPython and how to schedule tasks. After that, it's up to the developer to decide on the order. As strange as this may sound, I would also encourage readers to make sure they read the last chapter as well, which introduces the pyboard-D, which may be the development board they decide to go with for most of their experimentation.

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the Support tab.
  3. Click on Code Downloads.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/MicroPython-Projects. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Create new modules for each module that will be tested with _tests.py appended to the filename."

A block of code is set as follows:

def system_init():
print("Initializing system ...")
print("Starting application ...")

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

 try:
PushButton = RGB_Button.DeviceIO.Read()
except Exception as e:
sys.print_exception(e)
print("Exiting application ...")
sys.exit(0)

Any command-line input or output is written as follows:

pip install pySerial

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "See the MicroPython documentation | Quick reference for the pyboard | MicroPython tutorial for the pyboard | 3. Getting a MicroPython REPL prompt for details."

Warnings or important notes appear like this.
Tips and tricks appear like this.
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete