parent
fc857f2b13
commit
c9ed87da7c
@ -0,0 +1,15 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=camera service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
TimeoutStopSec=5
|
||||||
|
#EnvironmentFile=/home/pi/CubeSatSim/.mode
|
||||||
|
ExecStart=/home/pi/CubeSatSim/take-photos.sh
|
||||||
|
WorkingDirectory=/home/pi/payload
|
||||||
|
StandardOutput=inherit
|
||||||
|
StandardError=inherit
|
||||||
|
Restart=always
|
||||||
|
User=pi
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import time
|
||||||
|
from picamera import PiCamera
|
||||||
|
|
||||||
|
camera = PiCamera()
|
||||||
|
#camera.resolution = (3280,2464)
|
||||||
|
camera.resolution = (2592,1944)
|
||||||
|
camera.start_preview()
|
||||||
|
|
||||||
|
current_time = time.strftime("%H;%M;%S", time.localtime())
|
||||||
|
current_time = time.strftime("%m-%d-%H%M%S", time.localtime())
|
||||||
|
camera.capture('/home/pi/payload/img'+current_time+'.jpg')
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo -e "\nScript to take pictures every 30 seconds\n"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
|
||||||
|
python3 /home/pi/CubeSatSim/take-photo.py
|
||||||
|
echo -e "\nTaking photo!\n"
|
||||||
|
sleep 28
|
||||||
|
|
||||||
|
done
|
||||||
Loading…
Reference in new issue