Strip a trailing space
[JMPrope_player.git] / BareButton.h
1 #ifndef BAREBUTTON_H
2 #define BAREBUTTON_H
3
4 class BareButton {
5 private:
6         uint8_t _pin;
7 public:
8         BareButton(uint8_t pin) {
9                 _pin = pin;
10                 pinMode(_pin, INPUT_PULLUP);
11         }
12
13         boolean isPressed() {
14                 return !digitalRead(_pin); // pin low -> pressed
15         }
16 };
17
18 #endif // BAREBUTTON_H