Skip to content

Instantly share code, notes, and snippets.

Avatar

Garrett J. LaFrance glafranceri

View GitHub Profile
@glafranceri
glafranceri / PIR_ESC.py
Created Nov 9, 2016
Smart Calendar Picture Frame - Python PIR Motion Sensor ESC_Key trigger script
View PIR_ESC.py
#!/usr/bin/env python
# PIR_ESC.py
# url: https://gist.github.com/glafranceri/5df7db9b64ed1a27a1f8cc8f46b772d2
# written by glafranceri@gmail.com
# This script is licensed under GNU GPL version 2.0 or above
# PIR_ESC.py needs uninput and RPi.GPIO to work
# Script needs to be run as root from the command line using sudo
# Press [Ctrl] + [C] to exit script
@glafranceri
glafranceri / uinput_test.py
Created Nov 9, 2016
Smart Calendar Picture Frame - Python uinput test script
View uinput_test.py
#!/usr/bin/env python
import uinput
from time import sleep
device=uinput.Device([uinput.KEY_H, uinput.KEY_E, uinput.KEY_L, uinput.KEY_O,])
sleep(2)
device.emit_click(uinput.KEY_H)
sleep(2)
@glafranceri
glafranceri / gpio_test.py
Last active Nov 9, 2016
Smart Calendar Picture Frame - Python RPi.GPIO test script
View gpio_test.py
#!/usr/bin/env python
import RPi.GPIO as GPIO
from time import sleep
# Set GPIO pin numbers to Board numbers
GPIO.setmode(GPIO.BOARD)
# Define PIR to be 10
PIR = 10