Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
int potPin = A5; // select the input pin for the potentiometer
int ledPin = 13; // select the pin for the LED
int val = 0; // variable to store the value coming from the sensor
// from https://bildr.org/2012/08/rotary-encoder-arduino/
int orange = 4;
int green = 2;
volatile int lastEncoded = 0;