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.
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.