Files
uDCCD/firmware/src/hw/potentiometer.h
2024-07-25 18:46:17 +03:00

40 lines
622 B
C++

#ifndef POTENTIOMETER_H_
#define POTENTIOMETER_H_
/**** Includes ****/
#include <stdint.h>
#include "../bsp/board.h"
namespace hw {
/**** Public definitions ****/
class Potentiometer
{
public:
Potentiometer(void);
~Potentiometer(void);
void init(bsp::AnalogIn* ain_ch, uint16_t low_deadzone, uint16_t high_deadzone);
uint16_t low_deadzone;
uint16_t high_deadzone;
uint8_t last_percent;
uint8_t update_ain;
uint8_t read(void);
#ifndef TESTING
protected:
#endif
bsp::AnalogIn* ain_ch;
};
/**** Public function declarations ****/
#ifdef TESTING
#endif
} //namespace
#endif /* POTENTIOMETER_H_ */