Posted   —   № 12
601 Views

Earlier in the year, the Scratch team announced the release of the Scratch 3 beta. Quickly after, the team at Robotical developed our own Scratch 3 extension to bring Marty to the Scratch 3 platform. Now two months after the release of our extension, we have been experimenting with cross product programming.

One product we have been experimenting with is the BBC Micro:bit. The Micro:bit is a small inexpensive microcontroller that allows for basic programming and includes features such as an accelerometer and a 24 LED grid.

During his weeklong work experience with us, Nick (a S4 Highschool student) experimented with Scratch 3 using both Marty and a Micro:bit together to enhance the coding possibilities. He broke the code down into three sections, with three core functionalities:

Section one - Using the Micro:bit to feedback information about Marty:

This section uses the 25 LEDs on the Micro:bit to give feedback on how Marty is doing. The main chunks of code tell the user three things:

  1. The first requires a little explanation: Marty has a built-in safety that will help to turn off the servo motors when there is to much strain on them, this helps to make sure that Marty doesn’t break. Nick programmed the Micro:bit to present textual feedback using its 24 LED grid to indicate if a motor had been turned off, and signal if the user needs to re-start the motors before programming can commence.

  2. The second acts to mirror the first in that it uses the Micro:bit’s 24 LED grid to indicate if all the motors are on, and Marty is ready to be programmed.

  3. The third chunk considers the time loops in place throughout the code and tells the user when the loop has started over.

Section two - Marty movements:

This section details the movement of Marty the robot. Again, this section can be broken down into chunks of code:

  1. The first chunk focuses on getting Marty to walk forward, backwards and sidestep simply by moving the Micro:bit in the direction you want Marty to move. This utilizes the Micro:bit’s internal accelerometer to detect the direction.

  2. The next chunk uses the two buttons on the Micro:bit: the first, to stop all of Marty’s motors and freezes him if you need him to stop moving quickly. The second button is used to perform the opposite and starts Marty up again by turning on all the motors.

  3. The final chunk consists of several little parts that simply make life a little easier. Snippets such as: resetting the LEDs on the Micro:bit and getting Marty to stand up straight. These sections do not use the Micro:bit directly but have the potential to provoke a reaction if they indirectly turn off the motors for example.

Section three - Marty’s battery:

This section controls the reactions to Martys battery. Using the Micro:bit’s 24 LED grid, we have programmed the Micro:bit to display the battery level textually. If the battery is at max, it will display “FULL”, if the battery is very low it will say “DEAD” and if the battery is in between, it will display a percentage. With the full release of Scratch coming early 2019, we will see a great increase in the ease of cross product communication and collaboration. We will also see the first instance of Scratch on iPads and tablets, bring coding even closer to pupils of all ages.

You can find our Scratch 3 extension here. We welcome your feedback and look forward to hearing all about your experiments!