Skip to content

Instantly share code, notes, and snippets.

@kjordahl
Created January 26, 2014 20:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kjordahl/8638952 to your computer and use it in GitHub Desktop.
Trigger shutter release with Raspberry Pi
"""
Control a camera shutter release on RTS pin of serial port
Author: Kelsey Jordahl
License: BSD
"""
import serial
import sys
import time
if len(sys.argv) > 1:
wait = float(sys.argv[1])
else:
wait = 5.0
s = serial.Serial('/dev/ttyUSB0')
s.setRTS(False)
while True:
print "snap!"
s.setRTS(True)
time.sleep(0.3)
s.setRTS(False)
time.sleep(wait)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment