A C library with functions for common formulas used on embedded systems.
Characteristics:
- Portable-ish: only
double
andfloat
depending on the compilation, are not portable. - Testable: 20+ tests.
- ESP-IDF support:
- Component name:
iot-lib-formulas
. - Configurable: using menuconfig.
- Component name:
Functions:
#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);
}
- CMake
- Ninja
- Visual Studio with C++ Tools
git clone https://github.com/gfurtadoalmeida/iot-lib-formulas.git
-
Generate the build files:
project.ps1 generate
-
Build:
project.ps1 build
project.ps1 test
To contribute to this project make sure to read our CONTRIBUTING.md file.