Hardware Reference
In-Depth Information
Figure 13-6:
he breadboard
layout of the
reed switch and
motion sensor
connected to the
Raspberry Pi.
Listing 13-1 Home Automation Using Motion Detection
#!/usr/bin/env python
“””
Home Automation using motion detection
For the Raspberry Pi
“””
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(13, GPIO.IN)
GPIO.setup(15, GPIO.IN)
def main():
motion = False
door = False
while True:
Search WWH ::




Custom Search