| 169 | } |
| 170 | |
| 171 | void checkButtons() { |
| 172 | static unsigned long lastDebounceTime1 = 0; |
| 173 | static int lastButtonState1 = LOW; |
| 174 | |
| 175 | int buttonState1 = digitalRead(BUTTON); |
| 176 | |
| 177 | if (buttonState1 != lastButtonState1) { |
| 178 | lastDebounceTime1 = millis(); |
| 179 | } |
| 180 | if ((millis() - lastDebounceTime1) > 50) { |
| 181 | if (buttonState1 == LOW) { |
| 182 | if (filled == 'F') filled = 'D'; |
| 183 | else filled = 'F'; |
| 184 | Serial.println(filled); |
| 185 | } |
| 186 | } |
| 187 | lastButtonState1 = buttonState1; |
| 188 | } |
| 189 | |
| 190 | |
| 191 | void scannerSetup(){ |