#ifndef PHOTORESISANCE_OHM_RETRIEVAL_H #define PHOTORESISANCE_OHM_RETRIEVAL_H #include const float mega2560_max_current = 50e-3; // 50 mA const float mega2560_max_vcc = 5.5; const int32_t r_voltage_divider = 330e3; // SensorOhm calculate the value of the photoresistor with the voltage divider circuits class SensorOhm { public: SensorOhm(uint8_t pin_analog_read = A0, float vcc = mega2560_max_vcc, int32_t rFixed = r_voltage_divider, float current = mega2560_max_current); void setup(); int32_t readResistance(); private: uint8_t pin_analog_read; float vcc; int32_t rFixed; float current; }; #endif