April 2020
Intermediate to advanced
294 pages
7h 53m
English
We are going to start our application by first importing the libraries and modules that we need for our application. First, we are going to use machine to access the GPIO ports. machine is a generic MicroPython library that will allow us to easily port our code to any MicroPython-based device. Next, we are going to use the socket library for all of our socket communications. We will use asyncio to schedule our application tasks. Finally, we will use ujson to create and parse JSON messages. The import section of our script will appear as follows:
import machineimport socketimport uasyncio as asyncioimport ujson
Read now
Unlock full access