blob: d95b717f2a4165c8004b1d302ee57a9d65244bee [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"
Austin Schuh6d5d9ae2015-10-31 19:39:57 -07005#undef ERROR
Brian Silvermanda45b6c2014-12-28 11:36:50 -08006
7namespace frc971 {
8namespace wpilib {
9
Brian Silvermancc5e1dd2015-01-26 17:47:01 -050010// Inverts the output from a digital input.
Brian Silvermanda45b6c2014-12-28 11:36:50 -080011class HallEffect : public DigitalInput {
12 public:
13 HallEffect(int index) : DigitalInput(index) {}
Brian Silvermancc5e1dd2015-01-26 17:47:01 -050014 virtual bool Get() override { return !DigitalInput::Get(); }
Brian Silvermanda45b6c2014-12-28 11:36:50 -080015};
16
17} // namespace wpilib
18} // namespace frc971
19
Brian Silvermancc5e1dd2015-01-26 17:47:01 -050020#endif // FRC971_WPILIB_HALL_EFFECT_H_