mpatronska
Posts: 14
Joined: Sun Jun 07, 2015 7:05 am

Motion sensor listener

Thu Sep 08, 2016 2:11 pm

Hello,

I tried the example shown in https://www.reddit.com/r/pi4j/comments/ ... r_example/

However the program does not output anything. I also tried the GpioMotionSensorComponent which comes with pi4j-device, but the behavior is the same.

When using the python example from https://www.raspberrypi.org/learning/pa ... worksheet/ - it is printing "Motion detected".

Do you know what is wrong with the Java sample? Thank you.

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Motion sensor listener

Thu Sep 08, 2016 4:50 pm

Are you running the latest version of Pi4J from 27th July? http://pi4j.com/

Try the examples from http://pi4j.com/example/more.html and https://github.com/Pi4J/pi4j/tree/maste ... /main/java rather than something old that you found on Reddit.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Java”