gfurtadoalmeida / iot-lib-formulas

Library with functions for common formulas used on embedded systems.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IoT Formulas Library

GitHub Build Status Bugs Code Smells Maintainability Rating Security Rating Quality Gate Status
A C library with functions for common formulas used by embedded systems.

Characteristics

Formulas For

Documentation

Everything is on the wiki.

Example: Calculate Temperature in ºC from Thermistor on a Voltage Divider

#include <stdio.h>
#include "iot_lib_formulas/voltage_divider.h"
#include "iot_lib_formulas/thermistor.h"
#include "iot_lib_formulas/temperature.h"

void app_main(void)
{
    float_type thermistor_resistance = volt_divider_resistive_calc_resistor_2(5.0,     // 5V in.
                                                                              10000.0, // 10K resistor 1
                                                                              2.5);    // 2.5V out.

    float_type kelvin = thermistor_calc_temperature_steinhart_betha(COMMON_THERM_PROBE_AMBIENT_TEMP_KELVIN,
                                                                    COMMON_THERM_PROBE_RESISTANCE,
                                                                    COMMON_THERM_PROBE_BETHA,
                                                                    thermistor_resistance);
    float_type celsius = CONV_KELVIN_CELSIUS(kelvin);

    prinft("Temperature: %f celsius", celsius);
}

About

Library with functions for common formulas used on embedded systems.

License:MIT License


Languages

Language:C 66.1%Language:C++ 23.2%Language:CMake 6.9%Language:PowerShell 3.7%