Currently working on script.
So far seem to have solved, button to shut down Pi
Mounting a USB stick to put the pictures on to.
Numbering pictures using a conversion of day and date with an added number.
Just need to solve running the programme from startup, including mounting USB as it seems to need this every time.
So far seem to have solved, button to shut down Pi
Mounting a USB stick to put the pictures on to.
Numbering pictures using a conversion of day and date with an added number.
Just need to solve running the programme from startup, including mounting USB as it seems to need this every time.
On this page I will put the python Code for working with the raspberry Pi, camera and GPIO pins.
Using idle3 My raspberry Pi is a model B pin 6 is ground Pin 12 is GPIO 18 Pin 11 is GPIO 17 This is the same in B and the new B+ Disclaimer, if you try out any of my programmes you do so at your own risk, but they should work :-) |
Idea is to have a programme where
It asks you what number to start numbering your pictures. It will give you a live view of what the camera is seeing. Press one button to take a picture (Blue) Press it again and it takes another one numbering them sequentially. To end the programme press another button (Red) |
import time
import picamera
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, GPIO.PUD_UP)
GPIO.setup(17, GPIO.IN, GPIO.PUD_UP)
picstart = input("Frame start number? ")
with picamera.PiCamera() as camera:
camera.start_preview()
frame = float(picstart)
while True:
if GPIO.input(18) == GPIO.LOW:
camera.capture('/home/pi/Desktop/frame%03d.jpg' % frame)
frame += 1
elif GPIO.input(17) == GPIO.LOW:
break
I put two switches on (simple press switches).
One end to ground (I used pin 6)
For taking a picture the other end of switch to pin 12(GPIO 18)
For breaking out of the programme pin 11(GPIO 17)
You have to run the programme from root
in terminal window
sudo idle3
in idle find the programme file and Open Module, if first time new module and type it in.
Then under run run module (if first time save it first)
asks you for frame start number ( I thought best to be able to start it at another number if you have already got a number one pic you want to save)
Press the take button to take a picture and the break button to finish.
One end to ground (I used pin 6)
For taking a picture the other end of switch to pin 12(GPIO 18)
For breaking out of the programme pin 11(GPIO 17)
You have to run the programme from root
in terminal window
sudo idle3
in idle find the programme file and Open Module, if first time new module and type it in.
Then under run run module (if first time save it first)
asks you for frame start number ( I thought best to be able to start it at another number if you have already got a number one pic you want to save)
Press the take button to take a picture and the break button to finish.