After setting up the hardware devices and saying hello, a few commonly used constants and variables are defined. These include the alarm threshold, display minimum/maximum, and camera orientation settings that were previously loaded from the thermalcamera_config.py file. Default values in Celsius are converted to Fahrenheit where needed.

# Convert default alarm and min/max range values from config file
ALARM_C = fahrenheit_to_celsius(ALARM_F)
MIN_RANGE_C = fahrenheit_to_celsius(MIN_RANGE_F)
MAX_RANGE_C = fahrenheit_to_celsius(MAX_RANGE_F)

Color values are defined next. The color definitions are used for the various text labels and measured values in the display's sidebar. The param_colors list is used by the setup helper that we'll discuss in the next section.

# Default colors for temperature value sidebar
BLACK = 0x000000
RED = 0xFF0000
YELLOW = 0xFFFF00
CYAN = 0x00FFFF
BLUE = 0x0000FF
WHITE = 0xFFFFFF

# Text colors for setup helper's on-screen parameters
SETUP_COLORS = [("ALARM", WHITE), ("RANGE", RED), ("RANGE", CYAN)]

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

This page (Constants) was last updated on Mar 08, 2024.

Text editor powered by tinymce.