|
Raspberry Pi 3B+Raspberry Pi
|
x 1 | |
|
Button |
x 1 | |
|
Raspberry Pi camera module (CSI interface night vision focal length adjustable) |
x 1 |
Push Button Stop Motion With Raspberry Pi
Before booting your Pi, you’ll need to connect the camera.
We will need to install the camera. To do this, go to the ribbon slot and use two fingers to pull up on both sides of the connector gently.
Now the connector is open. Insert the ribbon cable with the metal leads facing away from the Ethernet port. Make sure it's lined up, then gently press down on the connector. The cable should be locked in place, and we can now move on.
Using your breadboard and jumper leads, connect the Pi to the button as shown in the diagram below: (Image credit: RaspberryPi.org)
You must create a new folder to store your stills. In the terminal window, enter
mkdir animation
For the code, open Thonny python, then, type in the following code:
from picamera import PiCamera
from time import sleep
from gpiozero import Button
button = Button(17)
camera = PiCamera()
camera.start_preview()
frame = 1
while True:
try:
button.wait_for_press()
camera.capture('/home/pi/animation/frame%03d.jpg' % frame)
frame += 1
except KeyboardInterrupt:
camera.stop_preview()
break
from picamera import PiCamera
from time import sleep
from gpiozero import Button
button = Button(17)
camera = PiCamera()
camera.start_preview()
frame = 1
while True:
try:
button.wait_for_press()
camera.capture('/home/pi/animation/frame%03d.jpg' % frame)
frame += 1
except KeyboardInterrupt:
camera.stop_preview()
break
Push Button Stop Motion With Raspberry Pi
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Engineer
-
Open Source Very Large Stick - Freejoy & MMjoy2 breakout board
319 0 0 -
RF Control training board for students based on ESP32 C3
443 0 2 -
Aquarius+ Computer, Standard PCB
635 0 3 -
KINETIC COASTERS with a TWIST! Laser or 3D Print some DIY Magic
467 0 1 -
RPI - 8 IO PLC With ATTiny85 Watch Dog
409 0 0 -
Nintendo Famicom HVC-001 Controller Shells
507 0 1 -
COMMODORE 128 DIAGNOSTIC REV.785260 KEYBOARD DONGLE
485 0 4 -
COMMODORE 128 15KHz DISPLAY ADAPTER (C128 80 COLUMN ADAPTER)
594 1 4 -