Created pot class
This commit is contained in:
35
firmware/src/hw/potentiometer.h
Normal file
35
firmware/src/hw/potentiometer.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef POTENTIOMETER_H_
|
||||
#define POTENTIOMETER_H_
|
||||
|
||||
/**** Includes ****/
|
||||
#include <stdint.h>
|
||||
#include "../board/ain.h"
|
||||
|
||||
namespace hw {
|
||||
|
||||
/**** Public definitions ****/
|
||||
|
||||
class Potentiometer
|
||||
{
|
||||
protected:
|
||||
board::AnalogIn* ain_ch;
|
||||
|
||||
public:
|
||||
Potentiometer(board::AnalogIn* ain_ch, uint16_t low_deadzone, uint16_t high_deadzone);
|
||||
~Potentiometer(void);
|
||||
|
||||
uint16_t low_deadzone;
|
||||
uint16_t high_deadzone;
|
||||
uint8_t percent;
|
||||
|
||||
uint8_t read(void);
|
||||
};
|
||||
|
||||
/**** Public function declarations ****/
|
||||
|
||||
#ifdef TESTING
|
||||
#endif
|
||||
|
||||
} //namespace
|
||||
|
||||
#endif /* POTENTIOMETER_H_ */
|
||||
Reference in New Issue
Block a user