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