Raspberry Pi Foundation ● Registered UK charity 1129409 ● Founded in 2009 to aid computing education ● On general sale since 2012, available to all worldwide – Sold to education, industry and hobbyists – Sold 6 million to date ● Free learning resources for makers and educators ● Free teacher training - Picademy (currently UK, soon USA)
Ben Nuttall ● Education Developer Advocate at the Raspberry Pi Foundation – Software & project development – Learning resources & teacher training – Outreach ● Hobbyist turned employee ● Based in Cambridge, UK ● @ben_nuttall on Twitter
Sonic Pi ● Sound synthesiser for creating music ● Audible computing ● Uses simple syntax text-based programming language Ruby ● Used for compositions and live coding performances ● Introduce computing concepts through music ● Created especially for education
Python ● Powerful extensible programming language ● Easy to read and write ● Make software, games, GUIs, websites, robots and more ● Ideal for physical computing ● Extensive library of additional modules for Raspberry Pi hardware ● Recommended for education
Flash LED with Python from RPi import GPIO from time import sleep GPIO.setmode(GPIO.BCM) led = 2 GPIO.setup(led, GPIO.OUT) while True: GPIO.output(led, True) sleep(1) GPIO.output(led, False) sleep(1)
Traffic Lights from RPi import GPIO from time import sleep GPIO.setmode(GPIO.BCM) red = 9 yellow = 10 green = 11 leds = [red, yellow, green] for led in leds: GPIO.setup(led, GPIO.OUT) GPIO.output(green, True) GPIO.output(yellow, False) GPIO.output(red, False)
Minecraft: Pi Edition ● Free version of Minecraft on Raspberry Pi ● Python programming interface ● Learn Python by building things and making games in Minecraft ● Creative computing
Flowers from mcpi.minecraft import Minecraft from time import sleep mc = Minecraft.create() flower = 38 while True: x, y, z = mc.player.getPos() mc.setBlock(x, y, z, flower) sleep(0.1)
Planting flowers grass = 2 flower = 38 while True: x, y, z = mc.player.getPos() # player position (x, y, z) block_beneath = mc.getBlock(x, y1, z) # block ID if block_beneath == grass: mc.setBlock(x, y, z, flower) else: mc.setBlock(x, y1, z, grass) sleep(0.1)
Picamera ● Official Raspberry Pi camera module ● Command line interface for basic use ● Python programming interface for projects ● Still pictures, video, time- lapse
Python – take a selfie from picamera import PiCamera from time import sleep with picamera.PiCamera() as camera: camera.start_preview() sleep(5) camera.capture('/home/pi/image.jpg') camera.stop_preview()
Python – stop motion with picamera.PiCamera() as camera: camera.start_preview() frame = 1 while True: next = input('Press Enter to continue...') camera.capture('/home/pi/animation/frame%03d.jpg' % frame) frame += 1