BBC Microbits and Learning to Code.

Where are all the Microbits? The what? Those teeny handheld computers that were given to all Year 7 schoolchildren last year. How many are lurking under a pile of stuff in classroom cupboards? or under a heap of clothes in a child’s bedroom?

The other week there was a beginners course on using the Microbit at my local library. Libraries, apparently, are picking up responsibility for coding clubs in the vacuum left by schools and our library now is the proud possessor of twenty microbits available for borrowing. So I went along. Maybe, at last, I would get to grips at last with the Microbit that I had bought in a rush of enthusiasm.

Microbits are so easy to use. All you have to do is . . .” Okay! Enough! Computer experts always forget that the rest of us are a bit daunted by anything that has more than an on/off switch. Last year there were many TV publicity pictures of school children playing with their Microbits and programming them to say, “Hello World.” (See Microbits) The children in these films were such good actors that they managed to look terrifically happy with such an achievement. Now, one year later there are more ideas for using the tiny computers. I rather liked the idea of operating on a Barbie doll to replace her arms with limbs controlled by a Microbit. Was not quite so keen, however, on gouging out the eyes of a doll’s head to replace them with LEDs.

. . . back to the beginners’ course at the library. We were shown how to attach the Microbit to our laptops then use the block programming tools to generate a pixellated image of a figure with waving arms. Well; it was a start.

Computing, coding and tinkering with tech week eight

Week eight I watched in admiration as young R coded up her game and then let me have a try..”
“I have made a quiz game. Do you want to try it?”

screenshot of Scratch computer qiz
Week eight, R’s quiz game
screenshot of Scratch computer quiz
second view of R’s quiz

 

 

 

 

 

 

 

 

So I looked at the question displayed, “2 + 4” and pressed “6”.
The next question was harder, “10 + 90” so I pressed “100” and elicited the response “You’re amazing.”

Meanwhile, B was working on his turtle graphics using Python. Not something he has learnt at school – he is still at Key Stage 2. His sister has been teaching him. I watched the Olympic Rings appear on the screen but unfortunately forgot to take a picture. Must remember my camera next week.

I and F who were working on the Edukit 3 robot set it aside this on week to work together on a website which is F is setting up for I. F encountered a problem with his laptop which he then proceeded to take apart to see whether he could fix it.

week eight, F taking laptop apoart
Fixing laptop

Sonic Pi re-visited

Just three more day before the deadline for the “write a tune for Tim Peake with Sonic Pi” challenge. Using “sonic Pi” does not depend on setting up a Raspberry Pi because the software may be downloaded onto any laptop allowing users to progress at their own pace. Headphone are essential – if only to protect everyone near by. As a non-musician it seems a great way to allow anyone who does not play an instrument to “make music” but I have wondered how musicians feel about it. Is a Sonic Pi tune really music? I suppose an analogy might be made by asking whether a computer generated picture is truly “art”.
Going back to Tim Peake.
>This competition offers a unique chance for young people to learn core computing skills that will be extremely useful in their future. It’s going to be a lot of fun!” said Tim Peake.

The winners will have their code uploaded to the ISS and used by Tim on the Astro Pi computers (on a best-effort basis subject to operational constraints).

David Honess, from the Raspberry Pi Foundation, spoke with Tim just before launch and learned that it is difficult to update the astronaut’s MP3 player while in space. “So there’s a practical, utilitarian purpose for having the students code this MP3 player for him. It’ll solve a real problem on the space station,” said David.

The first challenge is for students to write Python code to turn the Astro Pi into an MP3 music player, something that it was never designed for. The students will need to program the buttons, joystick and LED display to provide an iPod-like interface, so that Tim can plug in headphones and listen to music.

The second challenge requires students to compose their own music using a tool called Sonic Pi. This allows music to be created using lines of code, and is a really fun and engaging way to learn to program. Tim will then use the MP3 player code from the first challenge to listen to the second challenge’s music in space.>

I wonder how they will choose the winners? Elegance of code or the quality of tune? Or both

Sonic Pi and the latest Astro Pi challenge

CMD<create>CTRL has been up and running for one whole month. Where next? Sonic Pi? More Scratch? More work with breadboards and GPIO pins? The robot is now held together by double-sided Velcro and elastic bands – time, perhaps to review the chassis and think about modifications/ improvements. I learnt something last week. I had purchased a power-pack for the Raspberry Pi so that the robot could be freed from the power cable but when the youngsters attached it there was no power. As I was wondering whether I had kept the receipt and whether I had time to return the ‘faulty’ item, one of the lads enquired, “You did charge it didn’t you?” Oops! To be fair, there was no documentation inside the box that the power pack arrived in so I had assumed that it was ‘ready to go” just like an ordinary battery. Two of the girls will not forget the traffic light sequence which they needed to program the red, yellow (=amber) and green LEDs that they had connected to their Raspberry Pis via a breadboard.

Girl holding a Raspberry Pi and Sense hat
Marian explaining her entry for last year’s Astro Pi competition

More about ‘Sonic Pi’. Most of the youngsters know that British astronaut , Tim Peake, is aboard the Russian space-ship currently circling earth. Many also know that school pupils were challenged last year to design and code experiments for Tim to carry out using a Raspberry Pi plus a Sense Hat while in Space. In fact, Marian won “highly commended” for her entry. Now there is a new challenge involving Sonic Pi: “After the success of the first competition, Tim is now looking for more students to write code for him to run in space. The Astro Pi Coding Challenges, launched on February 3rd, pose a specific problem to the students and asks them to solve it with code.”. . .”There are currently two challenges on offer, which are both music-based. The first asks students to write Python code to turn the Astro Pi into an MP3 music player, something that it was never designed for. The students will need to program the buttons, joystick and LED display to provide an iPod-like interface, so that Tim can plug in headphones and listen to music. The second challenge requires students to compose their own music using a tool called Sonic Pi. This allows music to be created using lines of code, and is a really fun and engaging way to learn to program. Tim will then use the MP3 player code from the first challenge to listen to the second challenge’s music on board the ISS. The competition is open to all primary and secondary school-age students who are resident in the United Kingdom, and it’s supported by a comprehensive range of teaching resources that are available for free on the Astro Pi website. The deadline for submissions is March 31st.”

Plenty to do on Monday  . . .

 

 

Coding and ‘tinkering’ with Scratch and Python

Youngsters adding the code to control the robot.
Programming the robot.

This is our third week. Three youngsters sent apologies – they hope to be back next week. Blame the winter vomiting virus! The robot builders continued to add components to the robot and save the code to control it.  By the end of the session the robot would avoid bumping into the wall. Derek worked with one youngster and the “bike” kit. She successfully connected LEDs via a breadboard to a Raspberry Pi and programmed the lights to go on and off. Next week I have promised to introduce her neopixels and the ‘Crumble’. Her familiarity with Scratch should make it easy for her to programme the neopixels.

I have a Scratch problem to solve. Z created a game with two sprites bumping each other, then turning 180 degrees. Every bump decreased the character’s scores by 5. He wanted to make the character lie down when the score hit zero. Have been reflecting on the code. Is it possible to insert a “repeat until” inside an ” if . . . then” loop? And rather than lie down, maybe the character should just disappear?

Girl coding with Scratch
Using Scratch GPIO

I know that there is a “hide” in Scratch. We’ll work on this next week. Hope that M is better because she is an expert in Scratch.

Youngster on laptop using Scratch
Programming his own game with Scratch.

 

 

Second Coding Session

At our second coding session, a couple of youngsters worked on coding with Scratch on their own computers, sometimes reinforcing work they had done in school and sometimes exploring a new aspect. A couple of youngsters were pursuing their interest in Python while another two started to assemble the ‘Edukit 3’ robot kit. The instructions state “requires no soldering”, but the kit does require a base. So far the lads have attached the components with elastic bands and double-sided tape to a small off-cut of plywood. The double-side tape is not strong enough – so next week they are going to try either the sticky pads provided with the kit or extra strong Velcro. Just before we packed up they succeeded in getting the wheels to turn.

youngster holding a robot
The wheels turn!

Volunteer Derek guided two more members with a couple of SoSLUG “bike kits” – attaching LED’s to Raspberry Pi computers via a “breadboard” and programming them using the GPIO pins.

three people working on computers
Learning about Raspberry Pi and GPIO