#!/usr/bin/python
#
# camera orientation should be with the cable pointing downward.
# if you have it mounted the opposite (cable pointed upward) you
# will need to set both camera.hflip and camera.vflip to True.

import picamera
import threading

camera = picamera.PiCamera()

def snap():
  snap.counter += 1
  threading.Timer(5.0, snap).start()
  print "Taking picture %d" % snap.counter
  camera.capture('image_%d.jpg' % snap.counter)

camera.resolution = (640, 480)
camera.hflip = True
camera.vflip = True
snap.counter = 0

snap()
