Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Python Picamera with GPIO Zero
Search
Ben Nuttall
October 15, 2016
Programming
0
330
Python Picamera with GPIO Zero
Picamera workshop given at Pi Towers Raspberry Jam, October 2016
Ben Nuttall
October 15, 2016
Tweet
Share
More Decks by Ben Nuttall
See All by Ben Nuttall
Numeronyms are obnoxious
bennuttall
0
440
Live Highlights in BBC iPlayer
bennuttall
0
130
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
190
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
130
Running a Python Package Index for Raspberry Pi
bennuttall
0
160
From Acorns to Raspberries
bennuttall
0
140
Innovation in the newsroom
bennuttall
0
190
Innovation in the newsroom - MOS Running Order Manager
bennuttall
0
210
How to market your open source project
bennuttall
0
260
Other Decks in Programming
See All in Programming
MUSUBIXとは
nahisaho
0
130
Oxlintはいいぞ
yug1224
5
1.3k
CSC307 Lecture 05
javiergs
PRO
0
500
Data-Centric Kaggle
isax1015
2
760
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
SourceGeneratorのススメ
htkym
0
190
CSC307 Lecture 08
javiergs
PRO
0
670
CSC307 Lecture 09
javiergs
PRO
1
830
CSC307 Lecture 02
javiergs
PRO
1
770
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
54
8k
Statistics for Hackers
jakevdp
799
230k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
88
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
130
Google's AI Overviews - The New Search
badams
0
900
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
130
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
30 Presentation Tips
portentint
PRO
1
210
Transcript
Python Picamera with GPIO Zero Introducing the camera board and
Python module
Raspberry Pi camera module - 5Mpx / 8Mpx - Full
HD - Photo & video - Command line - Python module - Infra-red camera
Connect the camera
Add a GPIO Button
Boot the Pi and open Python 3
IDLE Python Shell >>> from picamera import PiCamera >>> from
gpiozero import Button >>> camera = PiCamera() >>> button = Button(17) >>> button.when_pressed = camera.start_preview >>> button.when_released = camera.stop_preview
Open a new file • File > New File •
File > Save • Save as camera.py
Take a selfie from picamera import PiCamera from time import
sleep camera = PiCamera() camera.start_preview() sleep(3) camera.capture("/home/pi/image.jpg") camera.stop_preview() Save and run: Ctrl + S F5
Add GPIO Button code from picamera import PiCamera from gpiozero
import Button from time import sleep camera = PiCamera() button = Button(17) camera.start_preview() button.wait_for_press() sleep(3) camera.capture("/home/pi/button.jpg") camera.stop_preview()
Add a loop camera.start_preview() for i in range(5): button.wait_for_press() sleep(3)
camera.capture("/home/pi/button%s.jpg" % i) camera.stop_preview()
Picamera effects
Picamera effects camera.start_preview() button.wait_for_press() camera.image_effect = 'negative' sleep(5) camera.capture("/home/pi/negative.jpg") camera.stop_preview()
Try more effects: - negative - colorswap - sketch - emboss
Picamera effects import random camera.start_preview() for i in range(5): button.wait_for_press()
effect = random.choice(list(camera.IMAGE_EFFECTS)) camera.image_effect = effect camera.annotate_text = effect sleep(5) camera.capture("/home/pi/%s.jpg" % effect) camera.stop_preview() Try more effects: - negative - colorswap - sketch - emboss
Documentation and help guides • picamera.readthedocs.io • gpiozero.readthedocs.io • raspberrypi.org/resources
• raspberrypi.org/education/downloads
What next? • Time-lapse • Stop motion animation • Wildlife
camera
What next? • Sensor trigger • Send to social media
• Robotics