User Tools

Site Tools


remote_fire_camera_via_gpio

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
remote_fire_camera_via_gpio [2017/02/04 21:47] – [See it in Action] walkeradminremote_fire_camera_via_gpio [2023/03/09 22:35] (current) – external edit 127.0.0.1
Line 91: Line 91:
 \\  \\ 
 <color red>Remember:</color> if you don't set the pins to low after shooting, it's the same as keeping your finger on the shutter button, the camera will just stay in shooting mode (but the shutter will close) and you won't see your preview image or be able to take any more shots. <color red>Remember:</color> if you don't set the pins to low after shooting, it's the same as keeping your finger on the shutter button, the camera will just stay in shooting mode (but the shutter will close) and you won't see your preview image or be able to take any more shots.
-<file>+\\  
 +<sxh [py][; options for SyntaxHighlighter]>
 #! /usr/bin/python #! /usr/bin/python
 # Python Script to fire Canon camera using 2 GPIO pins.  # Python Script to fire Canon camera using 2 GPIO pins. 
Line 130: Line 131:
 # Cleanup GPIO # Cleanup GPIO
 GPIO.cleanup() GPIO.cleanup()
-</file>+</sxh>
 \\  \\ 
  
Line 138: Line 139:
 We have used a simple program to fire the camera, but more useful would be to have some options. The following code prompts the user for two inputs, the first input is the number of desired photos to be taken, the second is the delay between photos. We have used a simple program to fire the camera, but more useful would be to have some options. The following code prompts the user for two inputs, the first input is the number of desired photos to be taken, the second is the delay between photos.
 \\  \\ 
-<file>+<sxh [py][; options for SyntaxHighlighter]>
 #! /usr/bin/python #! /usr/bin/python
 # Python Script to fire Canon camera using 2 GPIO pins. # Python Script to fire Canon camera using 2 GPIO pins.
Line 197: Line 198:
 # Cleanup GPIO # Cleanup GPIO
 GPIO.cleanup() GPIO.cleanup()
-</file>+</sxh>
 \\  \\ 
 \\  \\ 
Line 207: Line 208:
 \\  \\ 
 \\  \\ 
-{{:canon_30d_raspberry_pi_trigger_test_video.mp4?640x360|}}+{{:canon_30d_raspberry_pi_trigger_test_video.mp4|950x574|autoplay,loop}}
 \\  \\ 
 \\  \\ 
 This code will form the start of my Raspberry Pi Intervalometer. This will be a great tool for static time lapse photography. Once this is done then I can move on to my camera slider project. However the actual slide rails for this will I think take me some time. This code will form the start of my Raspberry Pi Intervalometer. This will be a great tool for static time lapse photography. Once this is done then I can move on to my camera slider project. However the actual slide rails for this will I think take me some time.
 \\  \\ 
- 
- 
- 
-<sxh [py][; options for SyntaxHighlighter]> 
-#! /usr/bin/python 
-# Python Script to fire Canon camera using 2 GPIO pins.  
-# Version 1.0 
-# Feb 2017 
-# Written in Python 2.7 
- 
-# Import libraries 
-import RPi.GPIO as GPIO 
-import time 
- 
-#Define numbering system for the IO pins Raspberry Pi.  
-#BCM = GPIO Numbers, Board = Pin Numbers 
-GPIO.setmode(GPIO.BCM) 
-  
-# Define GPIO ports for use with DSLR 
-gpioPins =  (20,21) 
- 
-# Setup channels for output and set initial values 
-for segment in (gpioPins): 
-  GPIO.setup(segment,GPIO.OUT) 
-  GPIO.output(segment,GPIO.LOW) 
- 
-# Set GPIO outputs to High, with a delay between the two GPIO outputs. 
-for segment in (gpioPins): 
-# Set first GPIO to High and wait 1s 
-  GPIO.output(segment,GPIO.HIGH) 
-  time.sleep(1) 
-# Set second GPIO to High and wait 1s 
-  GPIO.output(segment,GPIO.HIGH) 
-  time.sleep(1) 
-   
-# Ensure Both GPIO Pins are set to low 
-for segment in (gpioPins): 
-  GPIO.output(segment,GPIO.LOW) 
-  GPIO.output(segment,GPIO.LOW) 
-  
-# Cleanup GPIO 
-GPIO.cleanup() 
-</sxh> 
remote_fire_camera_via_gpio.1486244843.txt.gz · Last modified: 2023/03/09 22:35 (external edit)