Skip to content

Latest commit

 

History

History
93 lines (67 loc) · 3.53 KB

README.md

File metadata and controls

93 lines (67 loc) · 3.53 KB

IoT Formulas Library

GitHub Release Status Bugs Code Smells Security Rating Coverage Quality Gate Status

A C library with functions for common formulas used on embedded systems.

Characteristics:

Functions:

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

Getting Started

Requirements

Installation

git clone https://github.com/gfurtadoalmeida/iot-lib-formulas.git

Building

  1. Generate the build files:

    project.ps1 generate
  2. Build:

    project.ps1 build

Testing

project.ps1 test

Contributing

To contribute to this project make sure to read our CONTRIBUTING.md file.