We just launched Cubelets Console, a new way for you to play and learn with Cubelets. It’s awesome. Power up a few Cubelets and click the link on MacOS, Windows, or ChromeOS. There’s nothing to download and install!
If you’ve been playing with Cubelets for a while, you’ll be very aware that we’ve had a little ecosystem of different apps for different kinds of interaction. One for programming in C on a laptop, another one for Blockly, and the mobile-only app which does other things like Remote Control and Personality Swap. Now, Cubelets Console brings a ton of new functionality and interaction possibilities to laptops and desktops, at home or, when we get back to it, at school.
Console replaces the Blockly and C programming apps and lets you do both at the same time. It also lets you Personality Swap your Cubelets to change their behavior with pre-written programs. Most exciting for me, though, is the new Data Logger interface. Connect a Sense Cubelet or three and watch their block values change over time. Add an Inverse and watch the complementary graphs. See if your kid can make a sawtooth waveform with a distance sensor. Track temperature or light data and export it to a CSV or a Google Sheet. Experiment!
I’m at home this afternoon and I noticed that although the sun is streaming in a couple of south-facing windows, our little cactus was in the shade between the windows, a temporary dark spot as the sun tracks across the sky. I thought maybe I’d build a little self-driving car for the cactus. You know, like Uber for plants!
Cacti like to be in the sun, so I figured I’d start with a Drive Cubelet as the base and a couple of light sensors so that the robot knows where to go. But before I put a plant on top of anything, I knew I’d want to ease the back-and-forth motion of the robot so that it didn’t come to a jarring stop when it found light and bounce the plant right off. I thought it’d be elegant for the robot to slow its velocity along something like a sine wave. Sin() is a bit heavy for a microcontroller, so I found a web site that generated lookup values for a sine wave and tried pasting a few of those data values into a Blockly program (sine-down.cubelet) that sine-waves down from 127 (half speed) every few seconds. Then I found the magic of Console. I switched quickly back over to Data Logger to verify that my code was working and saw these little approximated sine waves.
Then I flashed the code into a Drive Cubelet and saw this:
Looking good. Next I attached a couple of light sensors and tried programming the Drive Cubelet as sort of a lopsided state machine. If a light sensor has light, then drive toward it for a half second, slow down, and begin again. It worked! The little platform is successfully moving the cactus to the brightest sunshine. It’d be fun to add a couple of distance sensors to make sure that the plant car doesn’t bump into anything or fall down the stairs, and maybe some down-low glow, but I’m pretty happy with this for now.
Where were we, anyway? Right, Console! Console is a huge upgrade to the high-ceiling Cubelets experience. I was just doing distributed robot programming using multiple languages and leveraging inter-robot messaging schemes. And it’s for kids! It’s super cool to be able to sketch out a program in Blockly and then pop into C to understand the exact code that got created. There are lots of ways to look at the same algorithm, and lots of ways to understand things. Give Console a try and let us know what you build.