Friday, 13 January 2017

Adafruit Circuit Playground with Scratch! ScratchX Extension from EmbedIt


We've tried out the ScratchX Extension from Embedit which allows you to program the awesome Adafruit Circuit Playground board using Scratch running in the Chrome web browser. This is something we've been waiting for. We mentioned that we were looking forward to a ScratchX extension in our Circuit Playground review and Robert Barron from Embedit dropped by and let us know it was ready.

We also used the Circuit Playground board in our Toothbrush Timer and Minecraft Pumpkin projects. For those projects we used the Arduino IDE which isn't really kid-friendly. Programming in Scratch on the other hand ...

What Does the ScratchX Extension Do?

The ScratchX Extension allows you to interact with the Circuit Playground board when it's connected to a PC via a USB cable. 

For example you can drag and drop Scratch blocks create a light show using the neopixels on the Circuit Playground. Or you can create a Scratch game that uses the Circuit Playground as a games controller, taking data from its sensors.

ScratchX is a version of Scratch that permits extensions to be used. It looks and behaves just like regular Scratch 2 in a web browser but allows extensions to add custom blocks. You can't share projects created with ScratchX. You can download them to your computer and upload them again. 


Unlike when you program the Circuit Playground with the Arduino IDE, you can't download your projects to the Circuit Playground to use independently with a battery. Often the kind of projects you make with Scratch make use of the Scratch stage so this wouldn't make sense anyway. There's plenty you can do with the Circuit Playground when it's connected to a PC via it's USB cable. 

Note that Embedit also make a Neopixel matrix product that can be attached to a Circuit Playground to give even more LEDs. The blocks to control the matrix are also included in the ScratchX extension which might be confusing if you only have a Circuit Playground board. 


Getting Started with the ScratchX Extension 


The ScratchX extension requires you to have custom firmware installed on the Circuit Playground board. You can by a device direct from them with the firmware installed or they have provided instructions for loading the firmware onto a device that you already have (or putting it back on there.)

We already have the boards so we've installed the firmware. Don't worry, it's very straightforward. You can find the instructions here.

We just had to:
  1. Install an app in the Chrome web browser. 
  2. Download and extract (unzip) the firmware. 
  3. Connect the Circuit Playground via a USB cable.
  4. Double tap its reset button and then check the COM port in the Windows Device Manager. 
  5. Run the downloaded firmware update program and give it the COM port, double tapping the reset button again, and then tap return. 

followed this approach and the Chrome app spotted the Circuit Playground immediately. The app helpfully allows you to launch starter projects to try things out. 

I tried a demo app and the indicator in the ScratchX extension went green showing that it was connected and I was able to change the colours of the neopixel coloured LEDs on the Circuit Playground and get data from the sensors. Yippee!

There's also a game that allows you to use the Circuit Playground as a games controller to move the position of a sprite and fire at a target which worked for us. This uses the accelerometer and one of the buttons on the Circuit Playground.


And we tried the Flappy Bird Touch example, we had to adapt this one as it was only checking for touch input to start the game, not to control the bird, but then it worked really well. The Circuit Playground supports capacititive touch so you don't need a ground and can just connect from a pad on the board to something conductive. 

It's worth noting that our experiences with ScratchX hardware extensions aren't always this smooth. 

The extension isn't complete. For example it doesn't have support for sound yet (the Circuit Playground has a small onboard speaker.) But you can of course use sound from Scratch on the PC alongside the Circuit Playground.

There's plenty of functionality here to allow young kids to easily create fun projects that use the Circuit Playground. Embedit recommends that it's suitable for kids from age 7 and up. 

Once you're set up there's a helpful guide to programming with the Circuit Playground Scratch blocks which will give you ideas on what you can do with the extension. 

ScratchX Extension vs ScratchX Arduino Extension

Note that there's also a ScratchX extension for Arduino which we have previously used with the Circuit Playground with the Firmata extension installed. 

We were able to get this working but it's not as nice as having a set of blocks that have been designed specifically for the Circuit Playground. Since the point of using Scratch is to make the Circuit Playground accessible to younger children we want things to be as simple as possible. 

We did get sound working via the Arduino extension so you may want to use it in some circumstances. 

Verdict

Having a ScratchX extension for the Circuit Playground makes it much more accessible to younger children that the Arduino IDE or Python options. 

Children are quite capable of understanding the concepts needed to work with the Circuit Playground hardware, they just need the right interface and for many kids, Scratch is it. 

It's not just that they drag and drop interface of Scratch works well. It's also that kids can make use of all the other capability that Scratch has so they can create projects that make use of the Scratch stage and the Circuit Playground hardware. 

We've seen this approach work really well with products like MaKey MaKey and the MakeBlock mBot

I'll be trying the Circuit Playground ScratchX extension out on my kids to see what they come up with so look out for new projects. 






More from Tech Age Kids:

Comments:

Post a Comment