Thank you for your answer.
I wish to use a more accurate solution and even a small camera on the ceiling is a nicer solution too.
Code: Select all
sudo echo 27 > /sys/class/gpio/export
sudo echo out > /sys/class/gpio/gpio27/direction
sudo echo 1 > /sys/class/gpio/gpio27/value
Code: Select all
sudo su
python program.pyCode: Select all
#!/usr/bin/env python
import RPi.GPIO as GPIO
import time
print (GPIO.VERSION)
GPIO.setmode(GPIO.BCM)
GPIO.setup(27, GPIO.OUT)
GPIO.output(27,True)
time.sleep(20)
GPIO.output(27,False)
Code: Select all
pigs w 27 1Code: Select all
pigs w 27 0Code: Select all
pigs r 27