Skip to content

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

Open
@grankee

Description

@grankee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions