The CircuitPython code for the Thermal Camera project is contained in four files:

  • code.py, the main code module,
  • thermal_cam_converters.py the temperature unit conversion helper,
  • iron_spectrum.py (in the index_to_rgb folder), the iron pseudocolor spectrum conversion helper, and
  • thermal_cam_config.py, the start-up default parameter file.

Code Details

Let's take a walk through the code and look in more detail how each section works starting with code.py.

The main module, code.py, prepares and operates the Thermal Camera. It consists of the following major sections:

  • Import and Initialize: Libraries, Devices, and Welcome Screen
  • Constants: Display, Min/Max, and Alarm Threshold Values
  • Helpers: Display, Buttons, and Setup Functions
  • Display: Define Group Layers
  • Primary Process: Setup and Loop

Things are started with importing libraries, establishing devices, and saying hello, all of which are described on the following pages.

Because of changes to ulab with the release of CircuitPython v7.x, the thermal camera code is no longer compatible with CircuitPython version 6.3.0 or earlier.

This guide was first published on Jun 09, 2021. It was last updated on 2021-06-09 17:11:13 -0400.

This page (CircuitPython Code Details) was last updated on Dec 21, 2021.

Text editor powered by tinymce.