Pins 1,3,4 and 8 are all GND.
Pins 2,6 are 3.3v.
Pin 5 is GPIO18.
Pin 7 is GPIO17.
http://www.sparkfun.com/datasheets/Sens ... PS0284.pdf
I was trying to adapt this:
http://ninjablocks.com/groups/raspberry ... ir-sensor/
Now, what happens when I run the script is it just says "No Motion." over and over.
As I was looking over the spec I thought maybe it was because Pin 6 in his guide is set to 3.3v, but if you look at the spec sheet it says GND-1.0v means MDT will go active when motion is detected and setting it to Vdd prevents MDT from going active. However jumping Pin 6 to GND did...nothing.
The only real troubleshooting I know how to do is to see what happens when I disconnect the device, at which point the script says False instead of True but past that I don't really know how else to troubleshoot it. Any ideas?
Code: Select all
GPIO.setup(17, GPIO.OUT)
GPIO.setup(18, GPIO.IN)
GPIO.output(17, GPIO.HIGH)
input_value = GPIO.input(18)
print(input_value)
while 1:
if GPIO.input(17):
print('No Motion.')
else:
print('Motion?')
sleep(2)
GPIO.cleanup()