Skip to content

Commit

Permalink
Create basic.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
lysek01 authored Mar 11, 2024
1 parent 2f38e03 commit db077eb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/basic/basic.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <PulseFlowMeter.h>

PulseFlowMeter meter;

#define PIN 35 // Input pin
#define K 25.613 // Pulses per liter parameter of flowmeter
#define MIN_FLOW 5 // Minimal flowrate treshold
#define MAX_FLOW 50 // Maximal flowrate treshold


void setup() {
Serial.begin(9600);
meter.begin(PIN, K);
meter.setTresholds(MIN_FLOW, MAX_FLOW);
}

void loop() {
Serial.print("Flowrate l/m");
Serial.println(meter.getFlowRateLiterMinute());
Serial.print("Flowrate m3/h: ");
Serial.println(meter.getFlowRateCubicHour());
Serial.print("Total volume: ");
Serial.println(meter.getTotalVolume());
delay(500);
}

0 comments on commit db077eb

Please sign in to comment.