Warning message

The service having id "facebook_widget" is missing, reactivate its module or save again the list of services.

programming

Raspberry Pi and PiFace

My PiFace arrived last week and this was the first time I've had a proper play using it with the Raspberry Pi.

I needed to do some things first to get it working, and I thought I'd document it here for future reference. Your Raspberry Pi will need to be connected to the Internet for this install.

INSTALL

1. Firstly, the Raspberry Pi interfaces with the PiFace through SPI, so this will need enabling.

sudo pico etc/modprobe.d/raspi-blacklist.conf

Insert a # at the beginning of the line

 blacklist spi-bcm2708

like so
 #blacklist spi-bcm2708
 
2. Second, install the PiFace Digital libraries and change the permissions of the SPI interface. Luckily, running this command will automate the entire process.

sudo apt-get update

wget -O - http://pi.cs.man.ac.uk/download/install.txt | bash

And reboot your Pi once installed.

sudo reboot

TESTING

Use the PiFace emulator to test the input and outputs for the PiFace board.

You'll need to log back into your Raspberry Pi and start the GUI environment (startx)

Open the Terminal application and type:

piface/scripts/piface-emulator

This will enable you to test the inputs are recognised and the outputs software controllable.

USING PIFACE IN PYTHON

I was itching to begin controlling the PiFace board from within Python. I wrote a simple program to demonstrate it working.

import piface.pfio as piface
piface.init()
switch7 = piface.digital_read(7)
print switch7
if switch7 > 0:
   piface.digital_write(1,1)

This code simply switches output one on if switch7 is closed.

TeachMeet Essex (Chelmsford) - the home of professional CPD for teachers

I'm now very proud to have attended a TeachMeet Essex session held in Chelmsford, Essex. The host school, King Edward Grammar School (www.kegs.org.uk) was an amazing venue with its large tiered seating in the main hall. A delicious range of food had been prepared by the students themselves.

Nearly 200 teachers arrived for the 6pm start, with 20 presenters prepared to speak for 7 minutes (micro presentation) or 2 minutes (nano presentation.) The thing is, the batting order is entirely randomised through the use of the 'speaker fruit machine' - you only had a moments notice. Interesting.

The quality of the speakers was staggering and I would challenge anyone who could find another CPD event that could match the passion, dedication, knowledge, relevance shared, in just the 2.5 hours we had tonight.

I spoke about the use of the Raspberry Pi in the Primary Curriculum. This is a project that I'm already developing with Helena Gillespie at University of East Anglia. I'm also teaching our Year 5 & 6 cohort, programming using a range of programming environments, such as Scratch and Python.

If you are interested in what I said, you might like to look at my presentation (slides)

and / or

Watch the (then) streamed version of all the presentations at TeachMeet Essex

Finally, here is the Computer Science: A curriculum for schools document that I referred to at the end of my talk. This document was written by the Computing at School Working Group in March 2012. It is incredibly decisive and outlines the entire Computer Science curriculum for Key Stages 1, 2, 3 and 4. Well worth a read.

Subscribe to RSS - programming