滑鼠拆下來的滾輪編碼器 時序為 → CW A ----------- ------------- HIGH ---------- LOW ← CCW B -------- ---------------- HIGH ---------- LOW A B 1 1↓CW 1 0 0 0 0 1 1 1 1 0 0 0 0 1↑CCW 程式碼參考底下網址來源修改而來 #define ENCODER_A_PIN 2 #define ENCODER_B_PIN 3 unsigned long time = 0; long position = 0; long num = 0; void setup() { pinMode(ENCODER_A_PIN,INPUT); pinMode(ENCODER_B_PIN,INPUT); attachInterrupt(0, RotaryEncoder, LOW); Serial.begin(9600); ti...