added arduino rotary encoder

This commit is contained in:
bach
2025-05-30 15:36:48 +02:00
parent c63d1cc49e
commit 9250353c1c
37 changed files with 484 additions and 53 deletions
+1
View File
@@ -0,0 +1 @@
.vscode
+18
View File
@@ -0,0 +1,18 @@
#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);
}