By using this site, you are accepting "session" cookies, as set out in the site's Privacy Policy
Resources for learning about computing and programming . . .
See below for links to download ZIP files with a complete package of each day's handouts and resources. The handouts also include links to sites to download other software.
MyEasyPages™ - www.myeasypages.co.uk Use MyEasyPages™ to create a simple web page . . . . . . and show friends and family can see what you've produced
Arithmetic of Computers - www.arithmeticofcomputers.co.uk A structured guide to some of the basic maths of number systems and computers
Found something useful that isn't mentioned here? . . . Any ideas? Thoughts? Comments? Suggestions?
Then email me with details at Info@CodingIsFun.co.uk
CodingIsFun™ is FREE for non-commercial use, but . . . . . . COSTS time, effort and money to develop and maintain!
DONATIONS towards the cost of this and associated work, would therefore be much appreciated.
Thank You!
Not got a PayPal account? No problem! Just pay through PayPal with your credit or debit card.
Examples of suggested suitable donations (for personal / non-commercial / non-profit use) are:
PLEASE NOTE : The standard terms and conditions for use of this site are forpersonal / non-commercial / non-profit use ONLY. If you would like to use this site or any of the materials on it for anycommercial or profit-making activity, PLEASE CONTACT ME at Info@CodingIsFun.co.uk.
Back to main Resources page
A PIC is a very simple microcontroller - everything on a single chip. This session uses a PIC to implement the simple Scissors, Paper, Stone (or Rock, Paper, Scissors or . . . ) game.
The PIC
This includes both hardware and software.
How much hardware you get pupils to do will depend on their age and skills. As described here it was run in a primary school, so, for example, getting pupils to do any soldering was not a realistic option, but getting them to plug wires into headers to connect everything up was not a problem.
The software element demonstrates the basic write code / compile / run cycle using an Integrated Development Environment (IDE).
Microchip produce a development kit (PICDEM Lab Development Kit with PICkit 3) that includes the necessry PIC controller itself, a development board, programmer to connect the board / PIC to a PC and all the necessary software, tutorials and a bag of components (LEDs, resistors etc.) - available in the UK from RS Online at (currently) £94.50 plus VAT plus P&P.
PICDEM Lab Development Kit
For the game you will need additional components (the components in the kit aren't quite sufficient). The resources below include a component list from Rapid Online electronics - this list is complete and assumes you will use none of the bag of components from the PICDEM kit. Earlier in 2012, these cost 11.95 including VAT and delivery.
In addition you will need a supply of coloured wire (at least 7 colours).
The external components make up into 3 boxes - a master box, with a switch to start the game and 2 LEDs to indicate the winner - and two player boxes (red and green) each with 3 switches and 3 LEDs (switch + LED for each of rock, scissors and paper for the player to make their selection and indicate the selection made).
With hindsight, slightly larger boxes (in all 3 dimensions) would have made construction easier - so you may want to think about that when ordering components. The notes below also include a few other suggested improvements on my original design - all of these were included in later versions I built (isn't experience and testing wonderful . . . !!!).
For anyone comfortable using a soldering iron and with access to a pillar drill, construction should be straightforward.
Outside and inside the finished boxes
The basic setup is that you do all the development of software (written in C) on a PC, compile it and then use the USB PICKit 3 programmer to connect to the PIC on the development board and copy the compiled program to the PIC. Then disconnect the PICKit and run the program on the PIC.
Download and install the IDE and C Compiler from the Microchip web site.
You have a choice here. The X version is the most recent / up to date. But the older v8 may be easier to get started with as (at least in the kit I bought) the tutorials were based on v8. Up to you. Or try both. I've included code downloads for both versions below.
If you are not familiar with PIC programming, working through at least the first few tutorials (LED outputs / simple switch inputs / weak pullups) is strongly recommended.
For power, I used connected a battery to the terminals on the development board rather than using a power adapter or taking power from the PICKit.
Don't forget to include the "#define _LEGACY_HEADERS" line (see the handout) - I wasted a lot of time before I stumbled on that one.
The kit comes with several PICs, but the one you need is the same one as is used in the tutorials - the PIC16F690.
Where you're ready, create a new project and add the C source file for the Scissors Paper Stone game. Check that it compiles correctly.
With no power connected, plug the wires from the 3 boxes into the headers on either side of the PIC - by now you should be familiar with pin numbering and which way round the PIC is.
Then plug in the PICKit 3 and power, switch on, program the PIC, switch off, disconnect the PICKit and switch on again.
PICKit 3
After pressing the master start button, all LEDs should flash randomly for a few seconds then go off. Each player should then press and hold one button until the LEDs start to flash (end eventually go steady) to indicate the selections made and the winner. Press the start button again to start the next game.
The instructions in the main handout are based on how software and resources were set up on the network I was using. You may well have to make minor changes to the handout to reflect your network setup. In particular: * I had a folder set up containing the C program code; * The IDE and C Compiler were installed ready for use on computers.
C has a lot of similarities with JavaScript, so a lot of the code should feel fairly familiar to pupils who have worked with Code Academy.
However, the #define pre-processor directives will be new.
The structure of the 'main' routine and control loop should be fairly readily explainable.
Concepts of inputs and outputs can be explained, looking at both the relevant sections of the control loop and the physical components. Even if pupils have not been involved in soldering components together, the insides of the boxes can be shown, the types of component discussed, what they do and how they are shown on the circuit diagram.
This is also an opportunity to introduce binary - 1s and 0s in software - high and low voltages in hardware.
Depending on how much physics pupils have done, a hardware discussion could extend to looking at the voltage output from the PIC, voltage drops across the LED and resistor, maximum allowable current drain from the PIC and current through the LED/resistor to determine a suitable resistor value and consequent power output (light) from the LED.
How far you go into the detailed game logic / game state / code will, depend on time and skills of the pupils. One possible area is what happens if a player presses more than one button or no button and how the code checks for invalid inputs.
At a simpler level, making changes to the timing values demonstrates that the code really is doing the work - there aren't any tricks anywhere.
For this session with pupils aged 8 to 11, a group of six round a table was ample. The session started with simply giving them a PIC (not in a circuit) and asking them what they thought it was, continued with a discussion of inputs and outputs, voltages on pins and binary, looking at the circuit diagram sheet and then the insides of the boxes and talking about the components being used and what they did, before getting them to take it in turns to plug in wires. We then went through what an IDE was, saw the code being compiled and copied onto the PIC (they quickly got to grips with plugging / unplugging the PICKit and switching power on and off), followed by them playing the game and seeing how changes to the code altered it.
To emphasise that PICs aren't just toys, we also talked about where a PIC might be useful in practice. Without actually pulling gadgets apart to see what's in them one never knows, but things like household appliances (e.g. toaster with LEDs / buttons) are good candidates.
Coding is Fun - Resources - 5 - PIC
Coding is Fun - Resources - 5 - PIC - Circuit Components
Coding is Fun - Resources - 5 - PIC - Component List
Coding is Fun - Resources - 5 - PIC - Wiring
For MPLab 8 : Coding is Fun - Resources - 5 - PIC - Scissors Paper Stone - MPLab 8
For MPLab X : Coding is Fun - Resources - 5 - PIC - Scissors Paper Stone - MPLab X
MicroChip Producers of PIC microcontrollers Download of software - IDE, compiler etc. MicroChip - www.microchip.com
RS Online Possible supplier for PICDEM Lab Development Kit with PICkit 3 RS Online - uk.rs-online.com
Rapid Online Possible supplier for other electronic components Rapid Online - www.rapidonline.com
This is a general list of possible additional resources that may be useful (in addition to those in the main Resources pages).
But please note that I have not tried using all of these so you'll need to put in a bit of groundwork yourself.
If you have any helpful comments on any of them or any others that might be added, please contact me at Info@CodingIsFun.co.uk.
Visual Studio is the name for Microsoft’s suite of Integrated Development Environments. 2012 is the latest version. Follow the Learn More link for downloads of versions for developing for Windows Desktop, Windows 8, Windows Phone and Web Sites. Express is the (slightly) stripped down free edition. Microsoft Visual Studio 2012 Express
The previous version, Visual Studio 2010 is also still available. Follow the See Download Details link for versions including the C# is the programming language. Other lnguages are available such as Visual Basic. Express is the (slightly) stripped down free edition. Microsoft Visual Studio 2010 Express
You might also be interested in Visual Studio 2010 for Windows Phone. With this you can develop XNA and Silverlight Apps for Windows phones (Silverlight also runs on PCs as well as Windows Phone 7). Microsoft Visual Studio 2010 Express
Somewhere in all this if you want to work with databases you may want to install some edition of SQL Server.
And you’ll probably encounter the .NET Framework, which is the technology that underpins a lot of Microsoft development stuff and helps link up various diverse technologies, development languages etc.
Note that Windows 7 or later is recommended for all this, even if not necessarily absolutely critical – and, as with all development software, plenty of RAM (my PCs have 6GB) and plenty of hard disc space are recommended.
For fancy graphics you’ll also need XNA Game Studio 4. XNA technology runs on Xbox consoles and Windows Phone 7 as well as on PCs. As a humorous aside, note that there are some people who claim XNA stands for "XNA is Not Acronymed". Microsoft say XNA doesn't stand for anything. Microsoft XNA Game Studio 4
Note that if you have a “.ac.uk” email address (or provide other accepted academic credentials) you can probably register at Microsoft’s Dreamspark site and get the “Pro” editions of this (and other) software [for non-commercial use only!] for free. Microsoft DreamSpark
For loading ISO disc images (which is what you get with some of the downloads), a tool like MagicDisc is helpful – or use Nero or any other CD/DVD burning software to burn the images to disc. Magic Disc
If you want to develop web sites, Microsoft’s web server is called Internet Information Server (IIS) – and ASP.NET is the web server extension that links IIS to the .NET Framework (and hence to development in .NET languages like C#) – there are plenty of (relatively) cheap web hosting companies that offer packages including IIS / ASP.NET / SQL Server and lots more – this is the one I use. Fast2Host
This is very versatile and quite powerful. As well as building the robots in the kit, you can design your own, with motors, lights and various sensors. Programming the robot can be very simple or as complex as you want it it with Lego's own easy to use graphical software or add-ons to Microsoft Visual Studio. Simple programs get stored and run on the Lego Minstorms NXT brick itself. For more complex things you can communicate with a PC while it is running and have a program on the PC control the robot. The robot connects to a PC via USB or Bluetooth. You'll probably want the 8547 kit (or the 9797 kit for education) to start with (unless Lego have come up with a newer version) - note that the Lego online shop is unlikely to be the cheapest place to buy it (unless you can get a special price for schools / academic institutions). Lego Mindstorms
For extra parts / spares, consider hunting on eBay . . .
For more advanced programming in C# using Visual Studio, download the .Net library from MindSqualls . . .
Note also that there is a new Mindstorms EV3 generation of products due out in 2013.
3D graphical programming - similar in concept to Scratch but maybe a bit more advanced. Alice
Graphical programming from Microsoft for PC and XBox. Kodu Game Lab
Tools for learning to programm in Java on Windows, Mac or Linux. Greenfoot
Software for app creation for mobiles from MIT. App Inventor
An alternative to PIC programming. Arduino
A simple robot that works with Raspberry Pi, Arduino - and Shrimp - processors. ShrimpBot
A grass roots organisation that aims to promote the teaching of Computing at school. Computing at School
A magazine (online and print) with lots of stuff about computing and its applications. Created with the aim of sharing the authors' passion about all things to do with Computer Science and published by Queen Mary University, London. CS4FN - Computing Science for Fun
A network of volunteers to run coding clubs in schools. Code Club
Software to learn programming in Ruby. Hackety Hack
A network of software developers and designers aged 18 and under. Young Rewired State
A wide range of devlopment boards based on PIC microcontrollers from MikroElectronika. MikroElectronika - EasyPIC
*** WARNING *** Do *** NOT *** confuse this with easypicDOTcom It is *** STRONGLY *** suggested that you block access to easypicDOTcom And do *** NOT *** use Google to search for EasyPIC
A JavaScript framework, rapidly becoming the de facto standard for simplifying programming in JavaScript, including providing lots of cool effects and solving a lot of the cross-platform web browser compatibility issues. Also think about using JQuery UI. JQuery
A language that extends JavaScript to make it a lot more friendly - and plugs into Visual Studio 2012 to give developers a much smoother development experience. Works with JQuery, but remember to include the jquery.d.ts TypeScript definitions file. You may also want to install the Web Essentials Visual Studio extension. TypeScript
Any ideas? Thoughts? Comments? Suggestions?
Found something useful that isn't mentioned here?
Any questions or difficulties?
Or after any further information?
Then email me at Info@CodingIsFun.co.uk
CodingIsFun™ originated with a series of sessions run outside normal school time in a primary school club, with small groups of children aged 8 to 11 (though CodingIsFun™ is just as much about teenagers and students as it is about younger children), aimed at giving them a broad flavour of what computing is about.
The emphasis was on having fun, getting them involved and variety rather than a systematic effort to turn them into programmers.
It certainly felt ambitious, but none of the pupils dropped out - the club was entirely voluntary, with no compulsion to attend - and the feedback was very positive.
And for the record (for anyone who might expect otherwise), it wasn't just boys - there were plenty of girls and they were just as good as the boys - but then it was a woman, Ada Lovelace, who arguably wrote the first ever computer programme!
Quite a lot!
I'm now running these sessions in 6 local primary schools - and developing ideas for other sessions. I'm involved with Royal Institution Masterclasses I'll be starting a series of sessions in a local secondary school as part of their lower sixth enrichment programme. I'm getting involved with staff at some local schools to introduce computing to them - especially in the context of Computing in the new National Curriculum from September 2014. And extending that to work with the Local Education Authority's Central Enfield City Learning Centre.
So things are quite busy
The simple answer is wherever it needs to to help get youngsters enthused about computing and programming.
It is (and probably always will be) a work in progress!
For one thing, computing doesn't stand still.
For another, there are lots of other people creating resources and tools and a major part of the aim of CodingIsFun™ is to help you find them.
CodingIsFun™ web site and content Copyright © TenScope Limited 2012, 2013, all rights reserved
Company registration no. : 06656008
Registered office : Suite F3 Sunley House, Olds Approach, Watford, England, WD18 9TB, United Kingdom
Contact Email : Info@CodingIsFun.co.uk
Use of this web site is subject to these Terms and Conditions and this Privacy Policy
JQuery is used under the terms of the MIT License. For further details, see http://jquery.com
Usage of code from (or based on code from) the following sources is also acknowledged: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
Use of relevant web sites and resources drawn from them is subject to the relevant terms and conditions specified on such web sites, including copyright and recognition of relevant trademarks.