Completing this incredibly simple task has meant I have had to learn some new things, gain a load of new skills and buy a load of stuff.
Other than a raspberry Pi, I literally had nothing, so to do this I had to get:
- Soldering iron kit - £9.99 (reduced from £25.99 - bargain!) - Maplin.co.uk
- Raspberry Pi GPIO Breakout Kit - £2.40 - HobbyTronics.co.uk
- Raspberry Pi GPIO 6" cable - £2.40
- 400 point Breadboard - £2.99
- 30 piece Breadboard Jumper Wire Kit - £2.39
- 3mm Red LED / resistor combo (pack 10) - £0.95
I had to solder the breakout board, what a pain that was, before I could build up my simple circuit.
GPIO -> Resistor -> LED -> Ground
Which looked like this.
I then wrote a small python program (using the excellent RPi.GPIO module), which set up the gpio pins and started an loop which set the value of the led to on and off, I used a try/except to capture the keyboard interrupt (ctrl c) so I could clean up before the program exited. I notice from looking online that most people don't perform the clean up at the end, its important you do otherwise you leave the gpio in same state it was when the program finished.
Run the program, which you have to do with sudo otherwise you dont have sufficient permission to access the gpio.