A Beginner’s Guide to Primary Coding

In the summer of 2014, I tirelessly tried out various resources and blogged about them as I went along, but this summer, I wasn’t able to blog as much for one simple reason…

This book.

I spent most of my summer holiday trying out new resources and rewriting existing pieces to create a simple guide to get teachers started with teaching coding.

I’ve tried to fill it with ideas and guides so I hope some of you get a chance to look at it and can let me know if it’s of any use!!

So, now that it’s in iBooks store, hopefully we’ll be back to business as usual!!

A Raspberry Pi Scratch Resource

Tomorrow I will be running a workshop for MozFest, a massive community event in London organised by Mozilla. Young Raspberry Pi enthusiast, PiNet creator and all round evil genius Andrew Mulholland somehow found himself organising a Rasperry Pi Zone at the event (I definitely had no involvement in this whatsoever) and so he coerced/bullied me into helping out.

This will be my first time running a workshop by myself for strangers (working with children you’ve known since they were four really doesn’t count) and I’m a little bit nervous, but I am pleased with the worksheet that I’ve created, so I figured it was worth sharing it with you guys. If you’d like to take a look, it can be found here. Please feel free to take it and use it in your own classrooms if you think it’s useful.

I’ve tried to make the worksheet easy to follow and easy to use with minimal resources – you need a Raspberry Pi with either Scratch GPIO or Raspbian Jessie, a PiStop, a PIR sensor and some female to female cables and that’s about it!

I’m planning on introducing the workshop by taking about the Pi and what you need to get it started; it never ceases to amaze me how little children know about the actual parts of a computer and most of them think that the monitor is the computer itself, so I like to spend time talking about what the parts do – the screen is so that you can see what it is thinking, the the mouse and keyboard are so you can control how it thinks, the SD card is it’s brain so that it can think and store memories, if you want to hear what any sound you need to plug in some speakers, if you want it to connect to the internet you need to give it a wifi card etc. The whole point of the Pi is to help children understand computers better so let’s make sure we’re using it properly!

You’ll be pleased to hear that I’ve forced myself to cut back on extra curricular activites after this weekend so hopefully I’ll have a bit more time to blog and try things out – I have so many toys in my collection ready to go!!

Thanks for reading and I hope the resources is of use to you!

Cat

A reflection on teaching coding

After another year at Pycon and really throwing myself into the coding community with my coding evenings and any other events that have caught my eye, I find myself reflecting on the purpose of teaching coding within a primary school. What do we hope to achieve by teaching complex languages like Python and Ruby? Why do anything other than Scratch? What do teachers really need to know to teach coding effectively?

In my own practice, I can say with confidence that I’ve made numerous mistakes trying to teach code, but one thing that became increasingly clear to me over last weekend was that it’s not WHAT languages of code you’re teaching that is important, it’s HOW you are teaching and whether you are demonstrating and modelling good practice to children yourself.

So, why are we teaching coding?

My understanding of coding as a subject has grown this year and I am now confident that teaching coding teaches children a number of critical thinking skills, not least of which is problem solving and error correction. If you’re using pre-packaged kits like Espresso Coding, you’re not going to be stressing these independent skills so it’s important that you allow children creativity in their coding.

This brings me nicely onto my second point…

What if the teacher doesn’t know much about coding?

One thing I realised over the weekend was that no one expects coders to know everything about coding. A lot of writing a programme is all about borrowing and modifying someone else’s code to suit your purpose and I think it’s really important to model that to the children you’re teaching. I make it clear that I’m learning to code with them and, if something isn’t working, we both look it up together and find some existing code to play with and fit to our purpose! Teaching doesn’t have to be someone stood at the front of the classroom pouring knowledge into their class’s heads…in fact, as adults, we constantly seek to further our knowledge by looking things up and investigating new ideas and outcomes, so why shouldn’t we model this for children? And hey, why not throw in a quick lesson on why some sources on the internet might not be as useful as others because of their source, their age or their content while you’re at it!

What languages should we introduce in the primary school?

There are lots of arguments floating around about what we should be teaching and why. I teach Python, Scratch and HTML in my primary school, but I don’t teach them as a separate and complete unit, rather I introduce the children to key concepts through playing and trying out projects if they feel ready to move on from block-based languages. I let the children make their own way through Codecademy *if they want to*, but I’m also happy for children to carry on using Scratch as long as they can achieve their purpose with it. My point about using Codecademy is that it isn’t an amazing tool for learning to code, but what it is, is a great way to learn some basic language as well as to encourage children to start supporting and debugging each other. It is only through ‘fixing’ someone else’s code that I learnt some of core ideas and the same is true with the children.

I also like to give children Python code for the various hats on a Raspberry Pi or for hacking Minecraft, but the purpose of doing this is firstly to encourage accuracy, but more importantly, to encourage the children to make changes and discuss what each line of the code actually achieves. It’s no good getting your children to blindly copy the code and then walk away claiming to know Python because they got blue flowers to follow Steve around the map.

Saying that, this is also true of Scratch – if you asked your children to create a platform game in Scratch without any instructions, would they be able to? Do they rely entirely on copying the information from the Code Club worksheet and then just walk away at the end or are they capable of manipulating their code to make something new and unique happen?

I am concerned that too many schools will suffer ‘death by Scratch’ or, even worse, ‘death by Espresso Coding’ by repeating the same, boring exercises over and over again each year without any practical application or opportunity to change the code and make it their own. It’s important that we are not just ‘teaching’ languages of code by following schemes of work and worksheets, but that we, as teachers, are thinking of innovative and interesting ways to use code to achieve an end goal.

Coding is a fantastic skill that can be used to achieve a broad range outcomes regardless of whether you are sticking to block-based code or moving on to a text language like Python, but only if we encourage creativity and playfullness with our code in the same way that we encourage creativity with our story writing.

So, there’s no surprises here, teaching code isn’t just about finding the best and most cutting edge resources, it’s about teaching effectively and modelling to the children, managing your expectations and encouraging them to be independent learners. What matters most is that you let children know that’s ok to get things wrong, it’s ok to look at other people’s ideas, it’s ok to not know everything straight away!

Enjoy teaching coding and make your classroom independent, interesting and fun; allow your children the chance to play, have fun and join in yourself. It shouldn’t just be the children that are enjoying your lessons about code!

Apologies for Silence

So, last year I spent my summer writing blog posts left right and centre and I have so many new products to try out and blog about, but I have a huge apology to make first… Basically, I started to write a short iBook about how to begin teaching primary coding which was aimed at primary school teachers like myself…this quick guide has slightly taken over my life and is now just shy of 50 pages with several sections left to go. Once I’ve got a first draft written and checked then I can pull my finger out and start blogging again, but just to wet your appetite, here are a few of the things I’ve got to blog about:

Hopscotch – block based coding on iPad

Gemma – arduino based wearable tech

Codebug – I’ve got one arriving in the post any day now

Mozilla learning platform

Explorer Hat Pro, Displayotron 3K and Unicorn Hat

So, you can see that I have a couple of bits & pieces ready to go in my pile of stuff to review, it’s just finding the time!! Please bear with me while I slog my way through permissions and acknowledgements not to mention glossarys and introduction videos!

Apple Distinguished Educator (ADE) 2015

So, this post isn’t specifically about coding in the primary curriculum, but I wanted to share with you nevertheless.

Last week I spent a week in The Netherlands courtesy of Apple who selected me as one of their distinguished educators for 2015. The ADE programme has been running for 21 years, since 1994, and there are currently over 2000 ADEs across the globe who are using Apple technology to support teaching and learning. This year, they selected around 650 worldwide, 50 of whom were from the UK, and these educators were invited to attend an institute in either Florida, Amsterdam or Singapore.

How are teachers selected?

In order to apply to become an ADE, teachers are required to answer 4 questions (within a specific character limit) and create a 2 minute video to share their story with the team. The idea is to show how you are making a difference and how Apple has helped in some way. For my application I focused on my community support work with Coding Evenings and supporting teachers within my school and the wider community. I mentioned use of iPad within the school and how 1:1 deployment has changed the way children study. For my video, I focused on the changes I’ve made and how I support people in my school – if you really want to see it, you can find it here.

My impression, from talking to other people there, was that Apple selected teachers who were collaborating, inspiring, innovating, supporting teachers and communities and making a difference to more than just their own class. The people who are seeking out new and innovative technologies that can truly make a difference to teaching and learning and are reaching out to share what they are doing with those around them.

What can you expect?

The first thing I found from joining the ADE community was that I had a ready made group of friends – there were lots of people who were keen to share their ideas and practice. There were lovely people as excited as I was to meet each other and one lovely teacher from France suggested we all bring souvenirs from our own country for a gift exchange. On the community site, I found a primary school teacher from Lincoln on the same flight as me and we headed off for a week in The Netherlands.

When we arrived at the hotel we were surrounded by loads of people wearing matching lanyards; we were all given a badge, jacket, t-shirt and itinary on Filemaker Pro and told to make sure we had our lanyards on display at all times.

The institute didn’t start until Monday, but we arrived on Sunday to have a chance to get to know each other, and it was a welcome opportunity to relax and get used to our surroundings. On Monday morning, we were in the hall by 7.45am and ready to start. Each morning started with some very loud house music pumping into the hall, which was overwhelming at first, but become completely unconcerning by day two.

Part of our first day was to split into learning communities – the presenters were keen to stress the importance of selecting a community that reflected your passions and not just what you teach and so, by lunchtime on day one, I found myself labelled as group leader of the primary coding group – 11 educators from around the EMEIA region (Europe, Midde East, India and Asia) with a similar passion for code.

There were a few activities that were focused on corporate stuff (correct use of the Apple logo, guidelines on creating iBooks in the Apple style) and presentations on Apple software, which encouraged me to think more carefully about some software that I’d previously dismissed, but the best and most interesting part of the whole week were the showcases by new and existing ADEs letting us know what they were doing to inspire other teachers and learners. All of the showcases were interesting and fascinating, but one or two were truly inspiring – my particular favourite were two women from the Czech Republic working in a special needs school and using iPad to support learning (they had me in tears with their story).

I also met some really wonderful educators that I plan to stay in touch with and share ideas with – I already can’t wait to meet up with them again. Special mention to my room mate for the week, Sarah Jones, who is using technology to bring together journalism students from around the world in a collaborative and interesting way; Benji Rogers, who supports and trains our next generation of teachers at Plymouth University whilst being a real life magician; Caz Barnes, a primary computing teacher in Geneva using green screen to make learning in Geography more interesting; Tim Lings, an inpiring techy teacher from London, who can moonwalk like a pro and last, but by no means least, my plane buddy and all round amazing teacher and amazing person, Chris Copeman, who kept me sane no matter what else was happening during the week.

Apple let us play with a load of third party tech such as Sphero and Dash, which can be controlled from an iPad as well as some other really cool tech and I’m already thinking about better ways to integrate this into my teaching in a cross curricular way.

I know there is a lot of anti-Apple sentiment out there, including some in the Pi Community, and I know some people will assume that the week consisted of a load of fans who love apple and love everything about them, but actually I felt like it was more about creating a learning community and collaborating with peers. Yes, there was a focus on Apple devices, but at the end of the day, the most important thing was about getting together and sharing what works. No one blinked an eye at me setting up a Raspberry Pi to demonstrate, in fact, a couple of the Apple staff came to take a look at what I was doing! I wouldn’t describe myself as a massive Apple fan, but I like my MacBook Air and iPhone and I like what they’re trying to do – I went in with my eyes open and was fully prepared to become annoyed with an overwhelming corporate message, but that just wasn’t the case. It was a lovely opportunity to meet some truly inspiring people as well as playing with some great resources and I’m so grateful to Apple for giving me a chance to meet them in such a lovely, friendly atmosphere.

So, if you are using Apple tech in an innovative way, consider applying because it really is an opportunity not to be missed.

Egham Jam & Picademy Round 2

As some of you may have noticed from my twitter, I’ve recently been invited to talk a couple of times about the things I’ve been doing since I attended Picademy last year. Firstly, I went to Egham Jam and met the lovely Albert Hickey, as well as a bunch of lovely and enthusiastic Pi people. Albert was showcasing his mind reading, flappy birds game, which had decided not to play ball, but was still interesting nevertheless. I also took a look at Seven Segments of Pi – a simple DIY introduction to coding and making, which really interested me and, when I have more time, I will definitely be taking a proper look. I was realy grateful to have the opportunity to talk to a room full of people which included school governors, children and makers. There were lots of questions, mostly from governors, who were really keen to get their schools involved with Coding Evening.

My next stop was day two of Picademy in Cambridge, where Carrie Anne Philbin had invited me to speak to the current cohort of RCEs about my journey over the last twelve months. It was a strangely exhilerating experience for me since it was exactly a year to the day since I attended Picademy and it was so refreshing to feel the energy and enthusiasm in the room. What I was not expecting was for Carrie Anne to tell the ‘students’ that I’d be on hand to do some primary level Scratch projects should anyone want to do that for their independent project so I was a little bit anxious when I sat down with two lovely ladies, Gill & Carol, to come up with a project that they could take home and show to their headteachers and demo easily in the staffroom. They both insisted that they wanted to use only the resources they had been given in their goodie bags, so we were lucky that they’d been given both a PiStop and a CamJam EduKit.

Without any input from me, the ladies came up with a project that I’d been looking at for a number of months, but still hadn’t put into practice: using Scratch with the PiStop, then the EduKit to demonstrate how to use a breadboard to create a circuit.

For the first part of the project, I knew what to do so I let the ladies work it out themselves, with a few gentle nudges from me; I was so impressed with their attitude and willingness to give things a go, especially with the difficult task of wiring up the breadboard. Just as we got it all working, Carrie Anne came in with a PIR sensor so that we could make our traffic lights sensitive to motion. All credit goes to James Robinson for help with Scratch as well as Martin O’Hanlon who helped us to solve the problem of how to detect someone jumping the lights! The ladies were really pleased with their final project and couldn’t wait to take it back to school; I felt so excited and proud to have been involved and to help inspire them further.

I was also really pleased with the overwhelming interest the other RCEs had in my Coding Evening project – there were at least three people who were keen to start their own and I’m really excited to be able to support teachers and other community groups with sharing their learning and ideas.

So, I’ve attended Picademy for the second time and, once again, I’ve left feeling ultra enthusiastic after meeting a great bunch of people who are all so eager to teach the new curriculum properly. I loved my first experience at Picademy, but I loved my second experience too and it still counts as my best training EVER. If you’ve not applied yet, make it your first priority next term – convince your SLT to let you take a couple of days off, do whatever it takes to get yourself up to Cambridge, or wherever else the course might be.

So, a final note, on Sunday, I fly over to Amsterdam to take part in ADE training with Apple (Apple Distinguished Educator) and I plan on wearing my Raspberry Pi Certified Educator badge with pride.

Learning to Solder – Zoo Kit

Last weekend I went to CamJam and I was very impressed with some small soldering kits   that Hannah Mills had bought from The PiHut called Learn to Solder Zoo Badge. I was absolutely gutted that they had already sold out, but fortunately they had plenty in stock on their website. At only £2 each I quickly ordered 4 different badges and eagerly awaited their arrival; the kits come in a variety of designs: Llama, Panda, Lion, Bunny, Sheep and Giraffe. Once I had my hands on them, I planned to spend an hour or two learning to solder, but it turned out that I really didn’t need that long at all!

So let’s start off with what’s inside the kit:

FullSizeRender FullSizeRender 3 FullSizeRender 2 IMG_6713

You will see that the kits come in a small hexagonal package which will fit easily into the palm of your hand. the kit is designed to cut and fold into a display case for your badge, which is a nice touch and the instructions are entirely graphical with very few words.

I’m pretty lucky to have a soldering geek at home to help me so he talked me through how to solder.

Before starting, Stuart talked me through all of his kit for soldering – he suggested that the bear essentials that you need are a soldering iron, some solder and a stand:IMG_6711The sponge needs to be a little damp before you start and, once the iron is hot, this can be used to clean off excess solder.

Super solderer Stuart also suggest getting a stand for whatever you’re soldering – he says his was about £5 from eBay and he quite rightly points out that this would make soldering easier and safer in schools, but that’s up to you to decide.

IMG_6716Before starting to solder, Stuart showed me the importance of the damp sponge – you can see in the first of these two pictures that the soldering iron is pretty mucky looking, but simply by touching it on the sponge while hot, it becomes clean. He also demonstrated how you can tell that the soldering iron was hot enough – simply by touching the end of the solder to the iron and seeing if it melts. *HEALTH AND SAFETY TIP* when there is melted solder on the end of your iron, it’s very easy to ‘flick’ it off, which is, of course, very dangerous and likely to cause burns – make sure you demonstrate this to children and explain why it’s a bad idea and why you must make sure that you wipe of excess solder onto the sponge!

IMG_6722    IMG_6723

At this point I was all ready to go, but Stuart once again had a good idea, he suggested having a go at a bit of soldering on some old cable and disappeared into a nearby cupboard, returning with this:

IMG_6717 He promptly stripped the end of an old European plug cable that he just happened to have in the cupboard and used a wire stripper to reveal the wires inside.

IMG_6718IMG_6720 IMG_6719IMG_6721

First I had to twist two of the newly revealed copper ends together, then have my first attempt at soldering – Stuart patiently explained that I needed to heat up the area I wanted to solder with the soldering iron before carefully feeding the solder onto the now hot copper – if it’s hot enough, the solder will melt and spread around the area. You shouldn’t need to touch the solder onto the soldering iron, the heat transference should be enough to melt the solder without the two coming into contact!

IMG_6724So, my first bit of soldering done, we were ready to start looking at the badges – first step was to follow the instructions and carefully put the battery holder and LED into place. I was happy to just bend the LED to get it through the necessary holes, but once again, Stuart had a good idea and suggested using a pencil to carefully bend it and avoid breaking anything. It’s made really clear on the instructions how to insert the LED and which side of the LED is positive – the only thing that wasn’t clear was which way up to put the battery holder and I did have a moment of putting it on upside down and then having no clue about how it would stay in place (yes, I’m that stupid). Fortunately, once it was pointed out, it did make sense that it would sit upside down, slotted through the holes!

IMG_6714

IMG_6715With the two parts resting in the right place, I became really grateful for the stand as trying to solder without it might have been really tricky!

IMG_6716So, here you can see a short video of Stuart soldering the first of the LED pins:

And the finished result:

IMG_6727I’m not going to lie – we were both pretty impressed by the material the badge was made from as it didn’t seem to mind being touched by the soldering iron – this is a nice touch for beginners as it’s likely they will make mistakes and it’s nice to know that you can’t cause to much cosmetic damage!

So, my turn!

IMG_6728

I found soldering the pin really scary because I kept thinking that I would short circuit it somehow, but as long as I stuck to carefully heating the LED pin and gently touching it with the solder, everything went to plan. I found out afterwards that if I’d put too much solder on, I could’ve damaged the LED, but everything looked fine and the solder had just slightly come through on the back, which was exactly what we wanted.

The next step was to solder the battery – once again, click here for a handy video of Stuart demonstrating how to solder it.

Unfortunately, that left me with the harder battery pin to solder and this time I really struggled – I was terrified of touching the LED with the soldering iron and found it really difficult to let the pin heat up and gently touch it with the solder, but eventually, after three attempts, I got it done:

IMG_6730 IMG_6731

After snipping off the excess length on the LED pins, I was ready for the final step, which was to solder on the badge pin – the instructions ask you to put solder onto a patch of the badge and then attach the pin by holding it in place and adding more solder, a process known as ‘tinning’. This time I was really able to see the solder rapidly melt onto the badge – while I held my soldering iron still, the melting solder spread quickly around it; it really did appear as though the badge was sucking the solder from the end of the roll!

Once again the stand made life really easy as I was able to clamp the badge in place in order to apply the last two bits of solder.

IMG_6732 IMG_6733

The final step in the badge creation was that nice touch I mentioned earlier – to create a display case for your badge! The kit even contains some double sided tape to stick it all together!

IMG_6734 IMG_6735

So, why is this particular kit useful?

Firstly, it offers you a stress free opportunity to learn to solder – it doesn’t matter if you solder onto the badge, the solder just doesn’t stick to it.

You can’t cause too much damage if you go wrong – of the three bits of soldering you need to do, only one of them actually involves circuitry; both the battery holder and the badge pin are simple attachments rather than completing a circuit.

It looks nice – as an adult, I loved making a cute little badge to wear; I’m going to wear it to school on Monday with pride and show off to my class that I soldered it myself! I really like the display case and I like that the kit itself is so cleverly made with it’s fold out instructions and display case pattern. I think children will really love to make these badges and, if my sense of achievement is anything to go by, will feel really proud of themselves!

It’s affordable – For £2 you can’t really go far wrong and I’m tempted to buy a load for my Code Club as an end of term treat! Yes, you could buy components for cheaper, but this kit really does come with everything you need apart from the actual soldering iron and it’s a nice, safe way to start!

I cannot wait to show these off at my next Coding Evening – so, what’re you waiting for? Go and buy yourself a zoo of soldering badges!

An Update

Earlier this week, following on from the success of my previous Coding Evenings, I launched CodingEvening.org to share my idea for free evenings for teachers to learn from experts about how to implement the coding aspect of the new computing curriculum. My reasoning behind this is that I’ve had a few other teachers ask me about how to launch their own evenings so I thought it was worth having a dedicated site to help guide them. I hope that other people are willing to either organise their own or at least get involved if there is one in your local area!

In the last week I was invited to speak at both a Code Club London meetup and a CAS hub in Hammersmith. At the first event I was invited to talk about my Coding Evenings and about getting people involved in helping out in schools. At the latter I spoke to teachers about Raspberry Pi and demonstrated using the PiStop in the classroom. I also went to my first Raspberry Jam in Cambridge and got a chance to meet up with lots of lovely people. I didn’t get there in time to buy any Learn to Solder Zoo Badges from the PiHut, but I did manage to order some and I’m looking forward to writing up a blog about my first attempt at soldering. All praise to Tim and Mike for organising CamJam, it was a fabulous day and I’m so glad I was able to go.

For anyone interested in going, PyconUK have just announced an amazing offer for teachers – the first 40 that turn up will not only get a heavily discounted ticket, but their school will received £200 towards cover costs – what a bargain! Thanks to Nicholas Tollervey for sorting it out. Here’s my blog post about last year’s event. I would thoroughly recommend going if you can – it was really amazing last year.

Finally, if you’re interested in coming, the final Twickenham Coding Evening of the year will be on Wednesday 1st July in the Stokes and Moncreiff in Twickenham as usual. I hope to see lots of you there.

Raspberry Pi – an idiots guide to installing Raspbian on a Mac

So, once again I need to admit my ignorance…

A few weeks ago, my friend borrowed my SD card ‘to take an image’ and somehow corrupted it – I don’t know how and neither does he, but he did managed to back up all my files. So, I’ve not used my home Pi for a while because when I tried to follow the instructions to reinstall Raspbian, I got very confused and had a few failure methods on the way so I figured it was time I wrote a real, back to basics, idiots guide to installing Raspbian (by idiots, I mean me by the way).

So to start off, there are various different operating systems you can install on a Raspberry Pi – the most basic one is Noobs, which is the recommended OS for the Pi, however, I’d recommend going straight for Raspbian since it’s unlikely, as a beginner, that you’d want to use linux etc.

Download Raspbian from the Rapberry Pi website here. There are some instructions on this page for installing Raspbian, but I got in a bit of a muddle so let’s go even simpler. I’m a user of torrents so I used this method to download, but as long as you know where the file has gone, you’ll be fine (hopefully it has gone to your Downloads folder).

I’m currently using OSX Yosemite (10.10.3) so here’s how I managed to install Raspbian:

Firstly, I plugged my SD card into the reader on my MBA – You need to find the identity of the disk and you can do that through disk utility or through ‘about this mac’ – here’s a picture guide to this method:

Screen Shot 2015-05-29 at 10.41.23First, click on ‘about this mac’, then ‘system report’:

Screen Shot 2015-05-29 at 10.41.48Finally, select ‘card reader’ to get information about the disk – you will see that mine says “BSD name: disk3” so, very simply, my SD card is disk3.

Screen Shot 2015-05-29 at 10.42.08The next step is to open disk utility which can be found in utilites (accessed by typing in shift +⌘ + u):

Screen Shot 2015-05-29 at 11.02.31

Select your SD card – and choose the ‘Erase’ tab – *Warning* *Warning* *Warning* make sure you have selected the right disk to erase – double and triple check that you have your SD card.

Screen Shot 2015-05-29 at 11.03.17

Screen Shot 2015-05-29 at 11.12.17

Make sure you select Format: MS-DOS (FAT)

Screen Shot 2015-05-29 at 11.03.29

Screen Shot 2015-05-29 at 11.03.43

Screen Shot 2015-05-29 at 11.03.50

Finally, select your SD card and unmount it (not eject!):

Screen Shot 2015-05-29 at 11.04.16

Screen Shot 2015-05-29 at 11.04.23

You’re now ready for a bit of terminal!

When I opened up terminal (in utilities again), I was instantly placed into ‘my’ folder meaning the home directory for my user account (myname) – shown in this picture with a little house symbol.

Screen Shot 2015-05-29 at 11.19.53So terminal has automatically opened the ‘myname’ home directory.

Screen Shot 2015-05-29 at 11.21.31This is where I hit on a real problem – the Raspberry Pi site suggests typing this into terminal:

  • From the terminal run:
    sudo dd bs=1m if=path_of_your_image.img of=/dev/diskn

    Remember to replace n with the number that you noted before!

But, I didn’t know the path of my image! I knew it was in my Downloads folder, but I wasn’t sure how to access it – after an awful lot of trial and error I figured it out!

I was already at the home directory, so I needed to drop into downloads by typing cd Downloads into terminal then I could easily run the code – you’ll notice I changed the ‘diskn’ at the end to ‘disk3’ based on the BSD name I found right at the beginning.

Screen Shot 2015-05-29 at 09.44.04So, my final code looked like this:

Catherines-MacBook-Air:~ catherinelamin$ cd Downloads
Catherines-MacBook-Air:Downloads catherinelamin$ sudo dd bs=1m if=2015-05-05-raspbian-wheezy.img of=/dev/disk3

I was prompted to input my password and then terminal started writing my disk – until terminal finishes the task, I can’t do anything.

Screen Shot 2015-05-29 at 11.31.01

So when it’s all done and the terminal looks like this:

Screen Shot 2015-05-29 at 12.15.05

You can eject your SD card and plug it into the Pi.

Not long after I finished this, I was told by the lovely James of Raspberry Jam Berlin that you can write the image even quicker by using “rdisk3” instead of just “disk3” at the end of the code which should speed things up.

Sonic Pi

One of the things I was shown at Picademy, was Sonic Pi. At the time I thought it was a great resource, but too difficult for me. Since then, I was lucky enough to meet creator, Sam Aaron and persuade (ok..bully) him to visit my school and run an all day workshop about the software.

Sam’s goal is to make coding accessible to all, with real, tangible results quickly and easily; this, of course, appeals greatly to children – even one line of code in Sonic Pi can generate a simple sound that can be expanded and extended easily.

Sonic Pi was initially created for the Raspberry Pi, but is now available on both Mac and PC. It is free and easy to install and you can get started straight away.

Screen Shot 2015-04-03 at 13.27.36So, how does Sonic Pi work – the first thing you need to get to grips with is the tutorial at the bottom left of the page – clicking on the tutorial tab will open a collection of tutorials which will allow you to get to grips with how the system works.

Screen Shot 2015-04-03 at 13.30.13

You can see  in the first picture that there is a middle bar which allows you to select one of 8 workspaces where you can input your code.

The most simple thing you can do is play notes and ‘compose’ a tune using simple commands – to play a middle C, all you need to do is type:

play 60

or

play :c

or even

play :c4

If you’re musical, you may recognise that middle c is the 4th octave so yes, you could try ‘play :c5’ and play a different c. I’m not musical, so I’m content to say that these notes all make the same nice sound. Notice that there is a colon before the letter, but not before the number. It is important to remember this as it is one of the common errors that children will make.

You can obviously also put different notes in by using different numbers with the play command e.g. play 75 would play a higher note. The children in our workshop liked to see just how high you could get and soon found that somewhere over 100 the notes become too high to hear.

At this point, you could try play a selection of notes one after the other –

Screen Shot 2015-04-03 at 13.38.26

Guess what, this is code, things are never as simple as that – playing all of the notes laid out like this basically plays them all at once since there is no wait command between each note – the computer tries to play them all together. In this instance, they will play a chord because the notes complement each other, but if you try other notes you will simply make a cacophony.

Screen Shot 2015-04-03 at 13.40.36

So, by adding in a sleep command you can put a pause between notes.

One of the children I teach got this far and then carefully composed the Ride of the Valkyries in his own time, however, composing individual notes is not what Sonic Pi is really all about. The most interesting feature is to do with samples – as Sam explained to the children, in a musical context, a sample is a short snippet of sound which has been used to enhance a piece of music. It can be a complete piece of music or a simple drum beat. Sonic Pi has a large selection of built in samples which can easily be sped up, slowed down, cut short or looped and it is very simple to combine these for a lovely music effect.

So let’s say we want to play the sample :loop_amen

Screen Shot 2015-04-03 at 13.55.52

As soon as I type in ‘sample :’ then I get a drop down menu of all of the different samples – the children in the workshop absolutely loved having the opportunity to just play with each of the different samples and combine them to make new sounds.

The next thing you can do is play with the rate of the sample:

Screen Shot 2015-04-03 at 13.57.23

By adding in a rate you can make the sample either faster or slower – in this instance, the play back is half its usual speed so it sounds a bit like a Groove Armada track, but if you go the other way and speed it up to a rate of 1.5 it sounds much more like a jungle beat. Already our track is sounding pretty cool. You can also use negative numbers to play samples backwards…

So, now I added in a few notes to play with along with some sleep commands :

Screen Shot 2015-04-03 at 14.04.20Suddenly I have actual music coming out of my speakers and, as I’ve already said, I’m about as musical as a dead fly. You can imagine the excitement of children who have quickly and easily managed to make lots of music with a few simple instructions.

I’m going to finish the what you can do section here – there are so many other things you can do with Sonic Pi, but really the best way to find out is to have a play yourself – there are simple instructions for looping bits of music- either for a certain amount of times or indefinitely:

Screen Shot 2015-04-03 at 14.25.39

Screen Shot 2015-04-03 at 14.26.07

You can alter the sound of the beeps with “use_synth” e.g.

use_synth :saw

The ultimate goal is to live code by using live loops which constantly play while the user updates small bits of code to alter the pitch or pace of the song.

So, why is Sonic Pi valuable?

As I’ve already mentioned, children love instant results and Sonic Pi more than allows that – one line of code and you have a nice little sample of music playing. It’s easy for children to make simple tweaks to code which have broad and obvious results. It’s also really easy to debug – the code is clearly coloured which gives children a clue as to whether their code is going to work. The children must make sure their code is correct – a lot of the children made mistakes with the sample command because when you type in the word sample it automatically loads a drop down menu:

Screen Shot 2015-04-03 at 14.36.16

They also frequently forgot to use a colon before listing the name of the sample so that, even when copying information from the board, they made errors. So, importantly, Sonic Pi can help with the important skill of debugging and the fact that children constantly need reminding to test their code frequently as part of the debugging process. Unfortunately, the current version of Sonic Pi doesn’t clearly let the user know what the error in their code is, but Sam is already working on making the error codes more clear for children (and their teachers) in future versions.

In terms of it’s musical usefulness, it can help children to gain a better understanding of pitch and pace and it can be surprising to see which children are particularly successful at writing phat drum & base tunes!

Key for me was that all of the children that took part in the workshop with Sam enjoyed themselves, enjoyed coding and left excited and eager to create their own music. Some of the children even emailed themselves their code to carry on working on it at home. These children were Year 4 and so only 8 or 9 years old, they were of mixed ability with many of them struggling with learning difficulties, however, they were all involved and they were all coding confidently. What surprised me most of all was that the most able children were not necessarily the most competent and in fact the two who produced the most eloquent pieces of music were both average ability children, only one of whom even played a musical instrument.

It takes a bit of playing and getting used to, but I really think Sonic Pi is an excellent resource for getting kids to learn how to code and to make them more confident and comfortable with the language of code. So, why not give it a go and remember, Sam is probably one of the most approachable people in this community and is more than happy to receive weird twitter questions in the middle of the night (trust me, I know this from experience).