sonar.h
742 Bytes
#ifndef __SONAR_H_
#define __SONAR_H_
#include <NewPing.h>
/* #include <Adafruit_BMP085.h> */
/* Adafruit_BMP085 bmp; */
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
Adafruit_BMP280 bmp;
Adafruit_Sensor *bmp_temp = bmp.getTemperatureSensor();
Adafruit_Sensor *bmp_pressure = bmp.getPressureSensor();
#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;
double temperature = 0;
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