Hardware Reference
In-Depth Information
if GPIO.input(13):
if motion == False: print “Motion Detected”
motion = True
else:
motion = False
if GPIO.input(15):
if door == False: print “Door Opened”
door = True
else:
door = False
time.sleep(.3)
if __name__ == “__main__”:
main()
Project 2: How to Monitor Your Home
with a Webcam
Webcams have been around for quite some time, but when you combine one with the small
form factor of the Raspberry Pi you can put surveillance easily anywhere in the home with-
out having to run cables back to a recorder or PC. In this project you will construct a webcam
surveillance monitor that will
Stream real-time video to a browser
Create e-mail alerts when motion is detected
Create stills and video iles when motion is detected
You can use this to increase the security of your home but also for other purposes, such as
keeping an eye on the kids around the house, knowing whether you left the garage door open
or receiving alerts and be able to see when someone walks through the front door. Table 13-2
shows what you need.
Search WWH ::




Custom Search