Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

RE: Ideas and PIR Sensor to LED Notification
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RE: Ideas and PIR Sensor to LED Notification

by silver2row on Sun Aug 11, 2019 9:04 pm

Hello,

Code: Select all | TOGGLE FULL SIZE
import Adafruit_BBIO.GPIO as GPIO
import time
#import tweepy
#import os
#import sys

GPIO.setup("P8_8", GPIO.IN)
GPIO.setup("P8_12", GPIO.OUT)

while True:
    GPIO.wait_for_edge("P8_8", GPIO.BOTH)
    if GPIO.add_event_detect("P8_8"):
        GPIO.output("P8_12", GPIO.HIGH)
        print("Motion Has Been Detected!")
        time.sleep(2)
    else:
        GPIO.output("P8_12", GPIO.LOW)
        print("No Intruders Yet!")
        time.sleep(2)


This is some software put together to try to give alarm via LED from a PIR sensor in Python3 on the BBB.

Seth

P.S. I change it a couple of times and I receive no errors but nothing seems to work. I keep waving but nothing has notified me via LED that the motion is being detected or not detected. Any suggestions?

silver2row
 
Posts: 177
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Ideas and PIR Sensor to LED Notification

by silver2row on Sun Aug 11, 2019 9:07 pm

Hello,

I did receive an error once. I cannot remember my source at the time but if it helps, here is the error:

Code: Select all | TOGGLE FULL SIZE
RuntimeError: (17, 'File exists')


Seth

silver2row
 
Posts: 177
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Ideas and PIR Sensor to LED Notification

by silver2row on Sun Aug 11, 2019 9:54 pm

Hello Again,

Do not worry about it. I think I figured out that these devices, the PIR Sensors, need about a one-minute interval to function properly. I will have to let the source run longer on my console.

Seth

P.S. Thank you for reading this bunch of confusion anyway. Testing will ensue!

silver2row
 
Posts: 177
Joined: Sat Jan 30, 2016 3:42 pm

Please be positive and constructive with your questions and comments.