legocoachandy

Simon - getButtonPress

Jul 21st, 2017
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. ///////////////////////////////////////////////////////////////////////////////
  2. uint8_t getButtonPress() {
  3. for (int b=0; b<4; b++) {
  4. for (int p=0; p<2; p++) {
  5. if (CircuitPlayground.readCap(simonButton[b].capPad[p]) > CAP_THRESHOLD) {
  6. indicateButton(b, DEBOUNCE);
  7. return b;
  8. }
  9. }
  10. }
  11. return NO_BUTTON;
  12. }
Add Comment
Please, Sign In to add comment