Cubelets Instructions

Document created by gjsissons on Sep 28, 2016Last modified by gjsissons on Oct 13, 2016
Version 13Show Document
  • View in full screen mode

 

Overview

 

Cubelets are pretty cool. These are basically small 1.5" cubes with magnets and connectors. When Cubelets get close to one another they snap together. They are produced by Modular Robotics out of Boulder, Colorado.

 

The Cubelets are grouped into categories of "Think", "Sense" and "Act". You can combine these different types of Cubelets in interesting ways to perform different functions and built various purpose-built / function specific robots. There is also a separate black Battery Cubelet that needs to be a part of any Cube combination because it provides power to the other Cubelets.

 

There is quite a good recent YouTube review by modrobotics that explains Cubelets and how they work very well. Have a look: https://www.youtube.com/watch?v=YPAOCOJibfQ

 

cubelets_youtube_video.PNG

 

Unboxing

 

Each team (quantities are limited!) that is interested in accepting the Cubelet Vantiv challenge will receive a kit comprised of twelve Cubelets.

 

They are easy to unpack and use. In our experience you could literally get your first "robot" working by combining cubes in about 30 seconds. They are that simple. Of course, building payment-enabled applications with Cubelets will be a little more challenging!

 

Setup

 

As you can see from the tutorial above Cubelets can be made to do interesting things right out of the box. Things getting even more interesting when you combine Cubelets with an operating system and connectivity to external devices.

 

A first step is to download the Cubelets app. It is designed to work with Cubelets OS 4.0 at the time of this writing. In fact, you can use the app to upgrade the Cubelets to the appropriate operating system version.

 

You can download the Cubelets App from the App Store or Google Play

 

Once the app is installed and running, you can use it to create remote control robots and read sensor data values. You can essentially perform "read" and "write" operations for the Robots you construct. To be controllable from an app, your Robot will need to include a Bluetooth Cubelet.

 

Writing Code

 

Cubelets Flash is a simple app for Mac and Windows that lets you drag C programs onto any Cubelet in a robot and reprogram in real time. Connect your Bluetooth Cubelet to your computer and unlock the power of Cubelets Flash to create new advanced behaviors for your robot constructions.

 

Why is it called Flash? Each Cubelet contains a tiny computer called a microcontroller. Typically, when engineers change the programming in a microcontroller, they call it “flashing”.

 

An excellent tutorial to help you get started using the Flash tool to program cubes is provided here: http://www.modrobotics.com/cubelets/apps/cubelets-flash/

 

To give you a flavor for Cubelet C programing language a sample program (flashlight.c) is replicated below.

 

Within the Flash tool you can target a Flashlight Cubelet and download this fragment of code below. The "block value" referenced below refers to the value of the input signal to the block. You'll want to connect a knob or distance sensor to provide an input value to the cube along with a Power and Bluetooth cube.

 

The program  below adjusts the rate at which the Flashlight Cubelet flashes depending on the input between 20 and 0.4 flashes per second.

 

#include "cubelet.h"
unsigned int last_flash_counter = 0;
void setup()
{
}
void loop()
{
    block_value = weighted_average();
    if (block_value != 0){ //no strobe should occur when block value is zero.
        if (last_flash_counter > 5+(255-block_value)) { //wait between 5 and 260 ~10ms intervals. Theoretically 20-0.4 flashes per second.
            last_flash_counter = 0;
            set_flashlight(255);
            wait(10); 
            set_flashlight(0);
        }
        else {
            last_flash_counter++;
            wait(10);
        }
    }
}

 

You can see the full API reference here: http://api.modrobotics.com/cubelets/

 

You can find lots of C code examples here: http://api.modrobotics.com/cubelets/dir_d28a4824dc47e487b107a5db32ef43c4.html

 

Controlling your Cubelet remotely

 

As readers might have noted, Bluetooth is presently the only way a Cubelet-based Robot can connect to the outside world. Interacting with a payment platform is usually done via a TCP/IP connection however and the Cubelets have no WiFi capability. This means that you will need some kind of intermediate node that is both Bluetooth and Internet capable to bridge these two worlds together.

 

Controlling Cubelets through the Bluetooth interface is not for the faint of hart. Luckily, our Hackathon developers are a hardy bunch!

 

A GitHub repository called "node-cubelets" is provided by ModRobitics that shows how to interact with the Cubelets by opening a serial / Bluetooth connection from Node.js. Details are provided here: https://github.com/modrobotics/node-cubelets. This is likely an important part of the puzzle for any workable commerce solution.

 

Hardware

 

Some of the different Cubelets are listed below. This will help give you a sense of the types of applications you can build.

 

  • Bar Graph Cubelet - Handy for debugging
  • Battery Cubelet - Every robot needs on of these
  • Blocker Cubelet - Passes power, but blocks data for neighbour cubes
  • Bluetooth Cubelet - A wireless link to upgrade, control or monitor cubes
  • Brightness Cubelet - A sensor that reads the amount of available light
  • Distance Cubelet - A sensor that detects how far it is from another object
  • Drive Cubelet - useful for propelling a robot across all surfaces
  • Flashlight Cubelet - Throws a beam of light depending on the input value
  • Inverse Cubelet - Flips the input value it encounters and relays it to the ouput
  • Knob Cubelet - A variable Cublet with a range between 0 and 1
  • Maximum Cubelet - Filters out all but the highest value input
  • Minimum Cubelet - Filter out all but the lowest value input
  • Passive Cubelet - Relays power, but does nothing
  • Rotate Cubelet - one face of the block rotates depending on the input
  • Speaker Cubelet - for building noisy robots!
  • Temperature Cubelet - sense the ambient temperature
  • Threshold Cubelet - react when an input reaches a settable threshold value

 

 

 

 

Privacy Policy, Copyright Notices, and Terms of Use

Cubelets, Cubelets Flash and Arduino are registered or unregistered marks belonging to their respective owners who are unaffiliated with and do not endorse or sponsor Vantiv. Vantiv likewise does not endorse or sponsor Modular Robotics or other companies referenced above.

Attachments

    Outcomes