Kinetic Sculpture  3.1
Software to Architecture for the Junior Kinetic Sculpture Project
 All Classes Files Functions Variables Macros Pages
Switch.h
Go to the documentation of this file.
1 
3 #pragma once
4 
11 class Switch {
12  public:
13 
19  Switch(int pin) {
20  switchPin = pin;
21  setupSwitch();
22  }
23 
29  void setupSwitch() {
30  pinMode(switchPin, INPUT_PULLUP);
31  }
32 
38  byte getState() {
39  return digitalRead(switchPin);
40  }
41 
42  private:
43  int switchPin;
44 };
void setupSwitch()
Definition: Switch.h:29
Definition: Switch.h:11
byte getState()
Definition: Switch.h:38
Switch(int pin)
Definition: Switch.h:19