M M
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?"
Hi @Camila_99$$ , I checked your code and you need to add and modify in any part.
add a function to adjust the increment dynamically base on the position.
float getIncrement(float pos) {
if (pos >= 0 && pos < 10) {
return 0.1;
} else if (pos >= 10 && pos < 20) {
return 0.5;
} else {
return 1.0;
}
}
then update the position in the loop.
9 replies