Guest User

Untitled

a guest
Jan 23rd, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. void loop()
  2. {
  3. state = (digitalRead(7) << 1) | digitalRead(5);
  4. if (state != prevstate) {
  5. if (state == nextEncoderState[prevstate]) {
  6. count++;
  7. } else if (state == prevEncoderState[prevstate]) {
  8. count--;
  9. }
  10. Serial.println(count, DEC);
  11. prevstate = state;
  12. }
  13. }
Add Comment
Please, Sign In to add comment