-enum Button_state get_button_state() {
- return
- (digitalRead(button_pin) == LOW)
- ? DOWN
- : UP; }
-void loop_asdf() {
- static Button_state button_state = getButtonState();
+void loop() {
+ static int count = 0;
+ Serial.print(count);
+ Serial.print(" ");
+ count++;
+
+ Button_state button_state =
+ (digitalRead(button_pin) == HIGH)
+ ? Button_state::up
+ : Button_state::down;
+ switch(button_state) {
+ case Button_state::up: Serial.print("up "); break;
+ case Button_state::down: Serial.print("down "); break; }