Skip to content

Instantly share code, notes, and snippets.

@rivsc
Last active September 13, 2018 06:02
Show Gist options
  • Save rivsc/1d4eadf6af545221797fbdb0913e12f4 to your computer and use it in GitHub Desktop.
Save rivsc/1d4eadf6af545221797fbdb0913e12f4 to your computer and use it in GitHub Desktop.
Raspberrypi with custom flash light
#!/usr/bin/env ruby
# @rivsc / http://blog.escarworld.com
require 'rpi_gpio'
PIN_NUM = 12
RPi::GPIO.set_numbering :board
RPi::GPIO.setup PIN_NUM, :as => :output
# Active le relais
RPi::GPIO.set_low PIN_NUM
`raspistill -vf -hf -n -ss 30000 -sh 70 -q 95 -t 50 -o photo_#{Time.now.strftime('%Y-%m-%d_%H-%M')}.jpg`
# Déactive le relais (retrouve son état normal)
RPi::GPIO.set_high PIN_NUM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment