Last active
September 13, 2018 06:02
Raspberrypi with custom flash light
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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