Python Forum
Help with taking pictures on raspberry pi - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Help with taking pictures on raspberry pi (/thread-24288.html)



Help with taking pictures on raspberry pi - octavia - Feb-07-2020

I am trying to automatically take a picture on a raspberry pi camera every 60 seconds. I am struggling to repeat the loop. Any help would be great thanks!

Current code:
from picamera import PiCamera
from time import sleep
import time
import os
import sys
from datetime import datetime

camera = PiCamera()

camera.start_preview()
for I in range(1):
	sleep(60)

camera.capture(‘/home/pi/Desktop/images.jpg’ % i)



RE: Help with taking pictures on raspberry pi - Larz60+ - Feb-07-2020

use a while loop around the code that you want to repeat.