Sign in:

Thousands of Tiny Robots

The Modular Robotics Blog

Cubelets Blockly

There are a lot of different ways to build with Cubelets.  Little kids, around 4 or 5, mostly like stacking them into tall towers and large constructions with flashing lights.  Older kids usually build with more focus, snapping together mobile robots that avoid walls or beep when they’re being chased.  Some people like remote-controlling their Cubelets robots with phones and tablets, and some people like integrating LEGO into their constructions.  Super enthusiasts with a lot of patience have been able to reprogram Cubelets in C, unlocking unlimited functionality at the price of a steep learning curve.

Now, using brand-new Cubelets Blockly, anyone can learn to program Cubelets and take robot blocks to a completely different level.  Blockly is a puzzle-piece programming language.  You drag programming pieces around on the screen in an easy interface, but still with all of the power and expandability that text-based typing languages provide.  Rad.  Purists and alpha geeks may still wish to write C programs using Cubelets Flash, but most of us at modbot are tending to use Blockly since it’s so fast for prototyping and quickly exploring ideas.

I just opened up Blockly on my Mac and wrote a simple program: the Paper Towel Dispenser.  An old standby.  You know, wave your hand in front of the sensor and the motor turns on for a few seconds?  It’s a super-simple version, but it worked on the first try!  The program looks like this:

Screen Shot 2016-10-26 at 11.22.42 AM

The program is written for a Distance Cubelet, so it monitors its distance sensor and then, when it detects a hand passing over it, sets its block_value to 200 for a couple of seconds.  I decided to write my program for the Distance Cubelet so that I could line up as many Drive Cubelets as I want to be a little conveyor belt and not have to program any of them.  I’m also dispensing a little aluminum ruler instead of paper towels, but that’s just a technicality.

It’d be easy to rewrite this program for a Drive Cubelet, and then I could stick on any type of Sensor Cubelet (not just Distance) and try to trigger the Drive.

Programming a whole pile of little robots instead of just one is an excellent way to see how there are often multiple ways to solve problems, and how small changes can have huge ripple effects in a complex system.

As I sit here enamored with my unimpressive ruler mover, Sam, our new Robotics Intern, is building a six-legged, catapult-equipped Cubelet/LEGO robot.  And he just finished documenting a Cubelets paper football goalpost robot with three levels of gameplay  which is pretty amazing.

pf finished bot

Programming and interacting with a whole bunch of tiny robots is different from working with just one.  Even though Cubelets Blockly is designed for kids, it contains some pretty advanced functionality.  With a multi-robot system like Cubelets, blocks need to send messages around to other blocks and things are happening in parallel.  We wrote a set of tutorials that highlights the key differences and walks you through building a few robots.

You’ll need a Bluetooth Cubelet and a few other Cubelets to play.  Today, Blockly runs on Macs and PCs, and we’re going to be launching iOS, Android and Chromebook versions later this year.

Happy hacking; let us know if you build something cool!

Join the Conversation  3 Comments
  • Ivan Hoe

    @Eric, learnt a new word from you > “Rad”.

    Why doesn’t Modular Robotics offer Cubelets Blockly in Android?

    Are there plans to offer Cubelets Blockly in Android?

    Thank you.

    Ivan Hoe (Singapore), customer of Modular Robotics, using Cubelets as a rad teaching tool, to kids and adults, since 2015.

  • Eric Schweikardt

    Hi Ivan: Thanks for your support! “Rad” may not be the most descriptive or eloquent of words, but it comes in handy sometimes and reminds me of being a kid in the eighties.

    We’re going to launch a Cubelets Blockly for Android at some point, but unfortunately I don’t have a timeline to give you. Even if I did, you can probably deduce from the timeline in my post that our software projects often take a bit longer than estimated. Anyway, we’re working on a Chromebook version first since many many of the teachers that we work with have Chromebooks in their classrooms. iPhone and Android to follow after that…

    Which Android devices are you using?

  • Ivan Hoe

    Hi Eric, thanks for your reply.

    I am using samsung galaxy tab 4 10.1. / Android 4.4.2.

    MY current HP 15-n235tx laptop which i bought in 2014 Sept, did not have bluetooth. Got to get a bluetooth adapter & then start playing with Cubelets Blockly.

    Take care.