Marvee Amasi
Marvee Amasi
DIIDevHeads IoT Integration Server
Created by Camila_99$$ on 9/27/2024 in #firmware-and-baremetal
How can I set variable increments for a rotary encoder?"
float getIncrement(float pos) {
switch ((int)pos) { // Cast to int for range comparison
case 0 ... 9:
return 0.1;
case 10 ... 19:
return 0.5;
default:
return 1.0;
}
}
float getIncrement(float pos) {
switch ((int)pos) { // Cast to int for range comparison
case 0 ... 9:
return 0.1;
case 10 ... 19:
return 0.5;
default:
return 1.0;
}
}
9 replies