blob: 407f2b944fd106d03d89df9d4d25e44ee28d8377 [file] [log] [blame]
Brian Silvermanda45b6c2014-12-28 11:36:50 -08001#ifndef FRC971_WPILIB_HALL_EFFECT_H_
2#define FRC971_WPILIB_HALL_EFFECT_H_
3
4#include "DigitalInput.h"
5
6namespace frc971 {
7namespace wpilib {
8
Brian Silvermancc5e1dd2015-01-26 17:47:01 -05009// Inverts the output from a digital input.
Brian Silvermanda45b6c2014-12-28 11:36:50 -080010class HallEffect : public DigitalInput {
11 public:
12 HallEffect(int index) : DigitalInput(index) {}
Brian Silvermancc5e1dd2015-01-26 17:47:01 -050013 virtual bool Get() override { return !DigitalInput::Get(); }
Brian Silvermanda45b6c2014-12-28 11:36:50 -080014};
15
16} // namespace wpilib
17} // namespace frc971
18
Brian Silvermancc5e1dd2015-01-26 17:47:01 -050019#endif // FRC971_WPILIB_HALL_EFFECT_H_