loop/theball-elec/theball-elec.ino
2025-05-30 15:36:48 +02:00

19 lines
288 B
C++

#include <Encoder.h>
long last_position = 0;
Encoder myEnc(2, 3); // pins for A and B
void setup() {
Serial.begin(9600);
}
void loop() {
long position = myEnc.read();
if(position != last_position){
last_position = position;
Serial.println(position);
}
delay(100);
}