Skip to content

StefanDraeger/Grove-Water-Level-Sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Grove Water Level Library

This tiny library is for read the current level from Grove Water Level Sensor. Please note that the code behind this library is from Seeed Studio - Grove Water Level Sensor. I've only put the code into a library to reduce code in my Arduino project, and now I like to share this with you.

Example

Here is an example, with initialize an Object of type WaterLevelSensor and call function with readPercentage.

#include <waterlevelsensor.h>

WaterLevelSensor sensor = WaterLevelSensor();

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

void loop() {
  //lesen des Grove Wasser Level Sensors
  int waterLevel = sensor.readPercentage();

  //Ausgeben des ermittelten Wertes
  Serial.print(waterLevel);
  Serial.println("%");
  
  delay(25);
}

The output is like the original one, with only the percentage of fill of cup.

Example with Grove LED Bar v2

At my blogpost Arduino UNO R3 & Grove LED Bar v2 you can find a example with the Grove LED Bar v2 device.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages