Testing Grove PIR motion sensor on Raspberry Pi - Raspberry Pi Forums
this first post,
print "hello world!"
i'm beginner user new raspberry pi.
i've bought 2 grove pir motion sensors (http://www.seeedstudio.com/depot/grove- ... p-802.html) , i'd use raspberry pi.
looking @ seedstudio git code (https://github.com/seeed-studio/grove-r ... _sensor.py) seems me no 1 testing return value of isdetected() function , print "pir sensor detected stuff".
said, i'm not able test these pir motion sensors other working code, such 1 @ link:
http://www.raspberrypi.org/learning/parent-detector/
i've connected vcc on pin2 of raspberry pi, gnd pin6 , d1 pin7 , run following python code:
i'm not able detect movement (i have tested seedstudio , raspberrypi.org code both 2 grove pir motion sensors)
have suggestions me , raspberry setup ?
help.
print "hello world!"
i'm beginner user new raspberry pi.
i've bought 2 grove pir motion sensors (http://www.seeedstudio.com/depot/grove- ... p-802.html) , i'd use raspberry pi.
looking @ seedstudio git code (https://github.com/seeed-studio/grove-r ... _sensor.py) seems me no 1 testing return value of isdetected() function , print "pir sensor detected stuff".
said, i'm not able test these pir motion sensors other working code, such 1 @ link:
http://www.raspberrypi.org/learning/parent-detector/
i've connected vcc on pin2 of raspberry pi, gnd pin6 , d1 pin7 , run following python code:
code: select all
import rpi.gpio gpio import time sensorpin = 7 gpio.setmode(gpio.board) gpio.setup(sensorpin, gpio.in, pull_up_down=gpio.pud_down) prevstate = false currstate = false while true: time.sleep(0.1) prevstate = currstate currstate = gpio.input(sensorpin) if currstate != prevstate: newstate = "high" if currstate else "low" print "gpio pin %s %s" % (sensorpin, newstate)
i'm not able detect movement (i have tested seedstudio , raspberrypi.org code both 2 grove pir motion sensors)
have suggestions me , raspberry setup ?
help.
i'd change pull-down pull-up. pir stuff i've used has pulled-down 0 on alarm.
raspberrypi
Comments
Post a Comment