The thermal_cam_converters.py module consists of two temperature converters, one for Celsius to Fahrenheit and the other for Fahrenheit to Celsius. The value to be converted is passed as an argument to the appropriate helper. Because the Thermal Camera's sensor has limited accuracy, a rounded integer value is returned.
# thermal_cam_converters.py def celsius_to_fahrenheit(deg_c=None): # convert C to F; round to 1 degree C return round(((9 / 5) * deg_c) + 32) def fahrenheit_to_celsius(deg_f=None): # convert F to C; round to 1 degree F return round((deg_f - 32) * (5 / 9))
Text editor powered by tinymce.