Writing the application

Now that we have the system test cases, our low-level drivers, and the hardware ready, it's time to develop the application. We are going to develop the application in five steps:

  1. Identify the imports we need.
  2. Define the constants.
  3. Define the application variables.
  4. Initialize the application.
  5. Create the main loop.

Let's look at these steps in more detail:

  1. First, we want to look at the imports that our application is going to need. By default, we always include the micropython and pyb libraries. Next, we need to review the classes that we are going to use. We need the PushButton_RGB class, which also has dependencies on Pin, Timer, and I2C. The complete list of imports can be seen in the following snippet:
import ...

Get MicroPython Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.