This commit is contained in:
Aditya Pulipaka
2025-11-16 20:05:18 -06:00
parent b893a1fa0f
commit d7da1172e1
7 changed files with 345 additions and 216 deletions

View File

@@ -1,6 +1,8 @@
#ifndef IND_SENSOR_MAP_HPP
#define IND_SENSOR_MAP_HPP
#include <stdint.h>
// Inductive Sensor Mapping Struct
typedef struct IndSensorMap {
double A;
@@ -11,21 +13,21 @@ typedef struct IndSensorMap {
} IndSensorMap;
class IndSensor {
public:
bool oor;
int mmVal;
public:
bool oor;
float mmVal;
// Constructor
IndSensor(IndSensorMap calibration, uint8_t analogPin);
// Read sensor directly from pin and convert to millimeters
float read();
// Constructor
IndSensor(IndSensorMap calibration, uint8_t analogPin);
// Read sensor directly from pin and convert to millimeters
float readMM();
private:
IndSensorMap consts;
uint8_t pin;
private:
IndSensorMap consts;
uint8_t pin;
// helper function to convert analog reading to millimeters
float toMM(unsigned int raw);
// helper function to convert analog reading to millimeters
float toMM(unsigned int raw);
};
// sensor instances