sonar.h 525 Bytes
#ifndef __SONAR_H_
#define __SONAR_H_
#include <NewPing.h>
/* #include <Adafruit_BMP085.h> */
/* Adafruit_BMP085 bmp; */

#define TRIGGER_PIN 1
#define ECHO_PIN 3
#define MAX_DISTANCE 100
#define seaLevelPressure_hPa 1013.25
#define containerBase 113 /* distance to ground in mm */
int measurements [] = {0,0,0,0,0};
int liquidLevel = 10;


int dubugLiquid = 0;


NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

void setup_sonar();
void loop_sonar(int counter);
double liquid_level();
double liquid_level_avg();

#endif