Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Physical computing with Scratch and Python
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ben Nuttall
March 21, 2016
Education
380
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Physical computing with Scratch and Python
Physical computing with Raspberry Pi using Scratch and Python with GPIO Zero
Ben Nuttall
March 21, 2016
More Decks by Ben Nuttall
See All by Ben Nuttall
Numeronyms are obnoxious
bennuttall
1
780
Live Highlights in BBC iPlayer
bennuttall
0
200
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
260
Rapid prototyping in BBC News with Python and AWS
bennuttall
0
200
Running a Python Package Index for Raspberry Pi
bennuttall
0
220
From Acorns to Raspberries
bennuttall
0
190
Innovation in the newsroom
bennuttall
0
250
Innovation in the newsroom - MOS Running Order Manager
bennuttall
0
270
How to market your open source project
bennuttall
0
310
Other Decks in Education
See All in Education
Railsチュートリアル × 反転学習の事例紹介
yasslab
PRO
3
190k
2026年度秋学期 統計学 第5回 分布をまとめるー記述統計量(平均・分散など) (2026. 10. 27)
akiraasano
PRO
0
200
Concours Photo - UGE - 2026
echaille
0
160
人間関係に取り組む、その時に / step away to make space
spring_aki
0
200
Liburd and Stoll Farrell "Copyright Essentials From A to AI: A 2026 NISO Training Series, Session Three: Exceptions for Libraries"
baltimoreniso
0
110
Digijulkaisut
matleenalaakso
1
10k
Session 3 - Mass Communication
adeputra13
0
330
HTTP APIs in Python
madhuri28
0
120
【ainiチャット】2段階認証設定方法
ainischool
0
160
Before You Scale: Understand the Theory Behind the Simulation
pfn
PRO
1
200
Liburd and Stoll Farrell "Copyright Essentials From A to AI: A 2026 NISO Training Series, Session Four: Copyright in Pop Culture and Digital Media"
baltimoreniso
0
110
BRIEF OUTLINE OF IMPORTANT PLANT CONSTITUENTS
pawan_pharm
0
270
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Practical Orchestrator
shlominoach
192
12k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
240
Site-Speed That Sticks
csswizardry
13
1.6k
Designing for Performance
lara
612
70k
Exploring anti-patterns in Rails
aemeredith
4
560
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
530
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Design in an AI World
tapps
1
380
Transcript
Physical Computing with Scratch and Python
None
Boot the Pi and open Scratch
GPIO Server • GPIO Server On
Broadcast • configXout • gpioXon • gpioXoff • wait X
secs • forever Component GPIO pin Red LED 25 Amber LED 8 Green LED 7 Buzzer 15
Close Scratch and open Python 3
Open a new file • File > New File •
File > Save • Save as camjam.py
GPIO Zero LED from gpiozero import LED led = LED(25)
while True: led.on() sleep(1) led.off() sleep(1) Save and run: Ctrl + S F5
GPIO Zero LED from gpiozero import LED led = LED(25)
led.blink()
GPIO Zero Button + LED from gpiozero import Button, LED
button = Button(21) led = LED(25) while True: button.wait_for_press() led.on() button.wait_for_release() led.off()
GPIO Zero Button + LED from gpiozero import Button, LED
button = Button(21) led = LED(25) while True: led.on() button.wait_for_press() led.off() button.wait_for_release()
GPIO Zero Button + LED from gpiozero import Button, LED
button = Button(21) led = LED(25) while True: led.blink() button.wait_for_press() led.off() button.wait_for_release()
Traffic Lights from gpiozero import Button, TrafficLights button = Button(21)
lights = TrafficLights(25, 8, 7) while True: button.wait_for_press() lights.on() button.wait_for_release() lights.off()
Traffic Lights from gpiozero import Button, TrafficLights button = Button(21)
lights = TrafficLights(25, 8, 7) while True: lights.blink() button.wait_for_press() lights.on() button.wait_for_release()
Traffic Lights from gpiozero import Button, TrafficLights, Buzzer from time
import sleep button = Button(21) lights = TrafficLights(25, 8, 7) buzzer = Buzzer(15) while True: lights.on() buzzer.off() button.wait_for_press() lights.off() buzzer.on() button.wait_for_release()
Traffic Lights while True: lights.green.on() sleep(1) lights.amber.on() sleep(1) lights.red.on() sleep(1)
lights.off()
Traffic Lights while True: button.wait_for_press() lights.green.on() sleep(1) lights.amber.on() sleep(1) lights.red.on()
sleep(1) lights.off()
Traffic Lights Sequence • Can you make a full traffic
lights sequence? • Use the button for a pedestrian crossing • Use buzzer.beep() to indicate safe crossing
Documentation and help guides • raspberrypi.org/documentation/usage/scratch/gpio • gpiozero.readthedocs.org • raspberrypi.org/resources
• raspberrypi.org/education/downloads
Physical Computing with Scratch and Python