Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rotaryEncoder.setEncoderValue(maxValue); sets to 0 when circleValues set to true #80

Open
grankee opened this issue May 22, 2024 · 0 comments

Comments

@grankee
Copy link

grankee commented May 22, 2024

rotaryEncoder.setBoundaries(0, 3, true); //minValue, maxValue, circleValues true|false (when max go to min and vice versa)
if circleValues is set to true and I set value to maximum in boundires(in this case it's 3) then it sets to 0
rotaryEncoder.setEncoderValue(3);
Problem does not appear if circleValues is set to false.

rotaryEncoder.setBoundaries(0, 3, true); //minValue, maxValue, circleValues true|false (when max go to min and vice versa)
rotaryEncoder.setAcceleration(0);
rotaryEncoder.setEncoderValue(_currentLEDs);
Serial.print("Cur _currentLEDs:");
Serial.println(_currentLEDs);
Serial.print("Cur encoder:");
Serial.println(rotaryEncoder.readEncoder());
Serial.println("0-3, 0acc,set LEDs");

Results in:

Cur _currentLEDs:3
Cur encoder:0

It works just fine with smaller values:

Cur _currentLEDs:0
Cur encoder:0
0-3, 0acc,set LEDs
Value: 1
0-255, 25acc,set brightness //printed by another part of program
Cur _currentLEDs:1
Cur encoder:1
0-3, 0acc,set LEDs
Value: 2
0-255, 25acc,set brightness //printed by another part of program
Cur _currentLEDs:2
Cur encoder:2
0-3, 0acc,set LEDs
Value: 3
0-255, 25acc,set brightness //printed by another part of program
Cur _currentLEDs:3
Cur encoder:0
0-3, 0acc,set LEDs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant