Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Encoder.h>
- // Connect your encoder to pins 10 and 12
- Encoder knob(10, 12);
- void setup() {
- Serial.begin(9600); // Start serial communication
- }
- void loop() {
- long pos = knob.read(); // Get the current position of the encoder
- Serial.println(pos); // Print the position to the Serial Monitor
- delay(100); // Wait for 100 milliseconds
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement