i received a lot of help to the Raspberry Pi study for yours thank you so much!! :)
but there is a problem to me.
i hope as follow 1. The record run 2. If the vibration sensor is detected during the recording, the recording should stop running 3. and the recording starts and againg in a different title.
Python source under are as follows vibration detect -> the picture are taken
Beneath the source is not a problem. but i don't know how to code the recording source...
ex) camera.start_recording("123.h264") camera.wait_recording(24*60*60) camera.stop_recording() ->>> is only recorded. During recording, the sensor is not detected..
What should i do...??
I've continued to find on Google, did not find....
import RPi.GPIO as GPIO
import datatime
import picamera
from time import sleep
count=0
GPIO.setup(6, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
sleep(0.1)
camera = picamera.PiCamera()
while True:
now = datetime.datetime.now()
result = GPIO.input(6)
if result == 1:
print("Vibrated".count)
count+=1
camera.capture("%d-%d-%d %d:%d:%d.jpg' &(now.year, now.month, now.day, now.hour, now.minute, now.second)