Data Gator
Hardware and software documentation for the Data Gator project.
Loading...
Searching...
No Matches
Atlas_Gravity_pH.hpp
Go to the documentation of this file.
1
11#ifndef ATLASGRAVITYPH_H
12#define ATLASGRAVITYPH_H
13#include <../../include/pHSensor.hpp>
14
19 public:
22
36 double getpH(double voltage){
37 double pH = (-5.6548 * voltage) + 15.509;
38 return pH;
39 }
40
46 std::string getSensorType(){
47 return "atlas_gravity_ph";
48 }
49
55 std::string toJSON(double voltage){
56 return "\"PH_RAW\": " + std::to_string(voltage) + ", \"PH\":" + std::to_string(this->getpH(voltage));
57 }
58
59};
60
61#endif
Defineds an analog pH sensor interface for the Atlas Gravity pH.
Definition Atlas_Gravity_pH.hpp:18
std::string toJSON(double voltage)
Converts a voltage reading to JSON string object.
Definition Atlas_Gravity_pH.hpp:55
std::string getSensorType()
Get the sensor brand and model atlas_gravity_ph for debugging.
Definition Atlas_Gravity_pH.hpp:46
double getpH(double voltage)
Converts analog voltage reading to a double pH value.
Definition Atlas_Gravity_pH.hpp:36
AtlasGravitypH()
< Constructor for object, no initialization here.
Definition Atlas_Gravity_pH.hpp:21
Interface for pH sensors.
Definition pHSensor.hpp:19
int reset_count
number of resets retrieved for NVS
Definition scheduler.hpp:31