This commit is contained in:
Aditya Pulipaka
2025-11-16 20:06:26 -06:00
parent d7da1172e1
commit 676e4d78a8
5 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#ifndef IND_SENSOR_MAP_HPP
#define IND_SENSOR_MAP_HPP
#include <stdint.h>
// Inductive Sensor Mapping Struct
typedef struct IndSensorMap {
double A;
double K;
double B;
double C;
double v;
} IndSensorMap;
class IndSensor {
public:
bool oor;
float mmVal;
// Constructor
IndSensor(IndSensorMap calibration, uint8_t analogPin);
// Read sensor directly from pin and convert to millimeters
float readMM();
private:
IndSensorMap consts;
uint8_t pin;
// helper function to convert analog reading to millimeters
float toMM(unsigned int raw);
};
// sensor instances
extern IndSensor indL;
extern IndSensor indR;
extern IndSensor indF;
extern IndSensor indB;
#endif // IND_SENSOR_MAP_HPP