You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use this program to get distances on a regular basis.
At first the program works fine.
However, it returns [-1] from around 50 to 130 times,
After working normally 2-3 times
Returns [-1] all the time.
Hello
I use this program to get distances on a regular basis.
At first the program works fine.
However, it returns [-1] from around 50 to 130 times,
After working normally 2-3 times
Returns [-1] all the time.
Normal value and pin status
1 pin_trig = ["pin_trig" <GPIO 24>] pin_echo = ["GPIO 25" <GPIO 25>]
2 pin_trig.getName () = [pin_trig] pin_echo.getName () = [GPIO 25]
3 pin_trig.getState () = [LOW] pin_echo.getState () = [LOW]
4 pin_trig.getPin () = [GPIO 24] pin_echo.getPin () = [GPIO 25]
5 pin_trig.getPin (). getAddress () = [24] pin_echo.getPin (). getAddress () = [25]
9 start_time: 45708706408821 end_time: 45708707102520
147 171 117
Bad behavior
1 pin_trig = ["pin_trig" <GPIO 24>] pin_echo = ["GPIO 25" <GPIO 25>]
2 pin_trig.getName () = [pin_trig] pin_echo.getName () = [GPIO 25]
3 pin_trig.getState () = [LOW] pin_echo.getState () = [LOW]
4 pin_trig.getPin () = [GPIO 24] pin_echo.getPin () = [GPIO 25]
5 pin_trig.getPin (). getAddress () = [24] pin_echo.getPin (). getAddress () = [25]
148 172 -1
After returning [-1], after post-processing such as
If you recreate the class, it will continue to return [-1].
sonic.gpio.shutdown ();
sonic.gpio.unprovisionPin (sonic.pin_echo);
sonic.gpio.unprovisionPin (sonic.pin_trig);
If you quit all the programs and run them again, it works fine.
However, it returns [-1] from around 50 to 130 times.
Is this a bug in pi4j?
The text was updated successfully, but these errors were encountered: