Closed bilderkiste closed 3 years ago
Which Pi4J version are you using?
I don't think blink()
has been implemented in Pi4J version 2 yet.
Hi. I am using version 1.2. And I think it is implemented
https://github.com/Pi4J/pi4j/blob/master/pi4j-core/src/main/java/com/pi4j/io/gpio/impl/GpioPinImpl.java and https://github.com/Pi4J/pi4j/blob/master/pi4j-core/src/main/java/com/pi4j/io/gpio/impl/GpioScheduledExecutorImpl.java
Have a nice evening!
Moved this issue to Pi4J v1.x repository.
@bilderkiste
Yes it is implemented in all versions of Pi4J v1.x.
It looks like the blinkState
argument is intended to set the START state for the blink operation to begin with.
See: https://github.com/Pi4J/pi4j/blob/5f7bc33d6bbc76e77da44408e915c36b316765ec/pi4j-core/src/main/java/com/pi4j/io/gpio/impl/GpioScheduledExecutorImpl.java#L157-L162
And it looks like it purposefully sets the inverse of the state argument provided when the blink stops after a given duration
interval period.
If the blink operation is manually stopped, I don't think there is any behavior to enforce the final state.
I did not find any documentation about this method, but I guess that the third argument of the method blink defines the pin state after blinking.
I wrote this line
pin27.blink(delay, duration, PinState.LOW);
But the LED keeps on. It should goes out after blinking.
pin27.blink(delay, duration, PinState.HIGH);
the LED goes out, that means pin state is low. I think it should be the other way, shouldn't it.