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

  • code.py, the main code module,
  • thermalcamera_converters.py the temperature unit conversion helper,
  • iron.py (in the index_to_rgb folder), the iron pseudocolor spectrum conversion helper, and
  • thermalcamera_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, Interpolate, Joystick, 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 starting with the release of CircuitPython 7.x.x, the thermal camera code is not compatible with earlier CircuitPython versions.

This guide was first published on Jun 09, 2021. It was last updated on Mar 28, 2024.

This page (CircuitPython Code Details) was last updated on Mar 08, 2024.

Text editor powered by tinymce.