Files
guadaloop_lev_control/IndSensorMap.hpp

38 lines
673 B
C++
Raw Normal View History

#ifndef IND_SENSOR_MAP_HPP
#define IND_SENSOR_MAP_HPP
// Inductive Sensor Mapping Struct
typedef struct IndSensorMap {
double A;
double K;
double B;
double C;
double v;
} IndSensorMap;
2025-11-16 13:50:04 -06:00
class IndSensor {
public:
bool oor;
int mmVal;
2025-11-16 13:50:04 -06:00
// Constructor
IndSensor(IndSensorMap calibration, uint8_t analogPin);
// Read sensor directly from pin and convert to millimeters
float read();
private:
IndSensorMap consts;
uint8_t pin;
// Read sensor and convert 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