Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void loop()
- {
- state = (digitalRead(7) << 1) | digitalRead(5);
- if (state != prevstate) {
- if (state == nextEncoderState[prevstate]) {
- count++;
- } else if (state == prevEncoderState[prevstate]) {
- count--;
- }
- Serial.println(count, DEC);
- prevstate = state;
- }
- }
Add Comment
Please, Sign In to add comment