LEDBarGraph - can't turn off last LED

Create issue
Issue #16 resolved
Patrick Kutch created an issue

After setting the value of the control to >0, setting back to 0 will not turn off last LED. The following is the modified init() method of Demo.java that will illustrate the issue:

@Override public void init() {
    control = LedBargraphBuilder.create()
                                .ledType(Led.LedType.HORIZONTAL)
                                .orientation(Orientation.HORIZONTAL)
                                .peakValueVisible(true)
                                .ledSize(32)
                                .build();

    control.setValue(.6);
    lastTimerCall = System.nanoTime();
    timer = new AnimationTimer() {
        @Override public void handle(final long NOW) {
            if (NOW > lastTimerCall + 100_000_000l) {
                //control.setValue(RND.nextDouble());
                control.setValue(0);
                lastTimerCall = NOW;
            }
        }
    };
    timer.start();
}

Comments (1)

  1. Log in to comment