i was very impressed with the kit from Maplin priced at £79.99. This is very comparable to buying each of the components separately.
The kit included the following:
• Raspberry PI Model B
• 4GB Class 6 Transcend SD Car (Pre-loaded with the latest pre-approved OS)
• Mains Powered 4 Port USB Hub (Increases the number of available ports to 5)
• N150 Wi-Fi USB Nano Dongle
• USB Keyboard
• USB Optical 3-Button Scroll Mouse
• 1.5m USB A to Micro B Cable with Gold-Plated Connectors
• 1.5m HDMI A to HDMI A Cable with Gold-Plated Connectors (To connect your Raspberry Pi to your HD TV/Monitor)
After the success of our first project we wanted to try building the traffic lights detailed on the OCR resource sheet here
After helping Philip solder the components onto a prototype circuit board we connected it up to the GPIO breakout board.
I showed Philip how to write the code to make one of the lights flash on and off. He was then challenged to find a way of making the three LEDs show the correct traffic light sequence.
In a similar way to the first project I was really pleased with the determination Philip showed in writing this simple piece of code.
import RPi.GPIO as GPIO
This project is based on a recipe card available here.
After buying our second Pi last week we were keen to start a project with components connected to the GPIO.
The code is relatively simple and the circuit basically involves connected a LED with resistor to the Pi GPIO breakout board (available here)
Once we had the basic code written and circuit created I asked Philip if he could adapt the code to:
- select how many flashes the LED will do
- the ‘on’ duration
- the ‘off’ duration
With the final code written Philip was very keen to show us code and flashing LED.
In comparison to the world of GTA5 a flashing LED seems very dull - but this little exercise of building and coding was very well received!
The final code is included below:
import RPi.GPIO as GPIO
print 'Welcome to the flashing LED program by Spencer and Philip'
print ' '
print ' '
print 'We first need to decide how many flashes we need'
flash = input('How many flashes would you like: ')
on = input ("how fast do you want the flashes to atay on in seconds ")
off = input ("how long do you want it to stay off for? ")
number = 0
for number in range (0, flash):
We have ordered a few more LEDs from CPC and are hoping to build traffic lights next weekend!
July 2012 was a great time for the Raspberry Pi in our house. We were a very early adopter and it became a very popular device during the summer holiday.
We made a number of videos showing some of the simple scratch games written by Philip at the age of 7. Whilst not being technically the most advanced pieces of code it did start him on a journey of discovery in coding.
Fast forward 18 month and my first Pi is now sat in the cupboard under the stairs as a file server and Philip has moved on from Scratch to writing batch files based on sample code he found online.
After much persuasion Philip encouraged me to buy another Pi for him to use for coding and playing Minecraft.
So here it is .....
After getting onto the Pi store we decided to download a couple of game tutorials. The first one we found was for a Raspberry Pi version of space invaders. After playing a few games Philip said “I wish I had more lives and I didn’t die when it hits the bottom”. This was a great cue from me to say - “If we have a look at the code we might be able to change it!”
This was the moment where the penny dropped for Philip.
After having such good fun with Scratch I do hope that this develops into something he will be interested in!