Home > other >  To control raspberries pie cameras, code running alone no problem, in the function have an error (or
To control raspberries pie cameras, code running alone no problem, in the function have an error (or

Time:01-15

Bosses, a program I think to control of raspberries pie on cameras, when alone run this code is no problem, but when I wrote him will be submitted to the following error function, bosses, please help me to answer it!

I was to create a folder, and then take pictures photos use timestamp to naming, the control of the GPIO pin is for the sake of taking photographs with a flash flash, part of the code (error function) is as follows:

 

Camera=PiCamera
OS. The mkdir ('/home/PI/Desktop/CZP)

Def picture_cjob () :
Timestart=time. Time ()
Timestop=timestart + 30
While True:
Timenow=time. Time ()
If (timenow & lt; Timestop) :
18, GPIO. The output (GPIO. HIGH)
Camera. The capture ('/home/PI/Desktop/CZP/' + STR (time. Time ()) + 'JPG')
18, GPIO. The output (GPIO. LOW)
Time. Sleep (2)
The else:
Brea

An error image is as follows:
  • Related