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


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

This guide was first published on Jan 29, 2020. It was last updated on May 21, 2024.

This page (Details: Converter Helpers) was last updated on Mar 08, 2024.

Text editor powered by tinymce.