Skip to content

Simple sensor class for value tracking and change detection

License

Notifications You must be signed in to change notification settings

KazaLab/KLib-Sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KLib-Sensor

KLib-Sensor is a lightweight library for managing sensor values and detecting changes.

Installation

Using PlatformIO

Add the following to platformio.ini:

lib_deps = https://github.com/KazaLab/KLib-EnvSensor.git

Usage

#include <KLib_Sensor.h>

KLib_Sensor temperatureSensor("temperature");

void setup() {
    Serial.begin(115200);
}

void loop() {
    float newTemperature = random(20, 30); // Simulated temperature value

    if (temperatureSensor.hasChanged(newTemperature, 0.5)) {
        Serial.print("New Temperature: ");
        Serial.println(newTemperature);
        temperatureSensor.updateValue(newTemperature);
    }

    delay(2000);
}

About

Simple sensor class for value tracking and change detection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages