Intro to Programming

Video ¶ 

Going from 0 to 60 in 3:30 (minus driver setup).

USB Drivers ¶ 

To connect the Hexbright Flex to your computer, you'll need to download and install USB drivers.

(Source: Silicon Labs)

Arduino Software ¶ 

To program the Hexbright Flex (or any other Arduino-compatible device), you'll need the Arduino software. This software can be used to edit programs, program the Flex, and communicate with a running Flex. If you already have the Arduino software installed, please note that we require at least version 1.0.1.

(Source: Arduino)

Arduino boards file ¶ 

In order for the Arduino software to be able to communicate properly with the Hexbright Flex, it needs to know a few things about the hardware. We can do this by adding a board definition file (boards.txt) where the Arduino software can find it.

Download this file. (Right-click, Save link as...)

Windows ¶ 

This file should be put in: <Sketches>\Hardware\Hexbright\boards.txt, where <Sketches> is the Arduino software's sketches folder, usually a folder named Arduino in your default documents folder. (On Windows, this would typically be: C:\Users\<User>\Documents\Arduino)

Block Image

Mac OS X ¶ 

Go to your Documents (~/Documents) folder and open the Arduino directory (create it if it doesn't exist). Create another folder within there called hardware and then one more within that called hexbright. Drop boards.txt in there. You can also download the hardware folder from the samples within the GitHub project and put it directly in the Arduino directory, as shown in the screenshot.

For the current version or Arduino on Mac OS X 10.8.x you will need to right click on Arduino.app

in the applications folder and choose "Show Package Contents" from there navigate to: /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/boards.txt

Open the boards.txt file from the file path as well as the one you downloaded. Copy the contents of the downloaded one to the top of the file in Arduino.app. Save the file and reopen Arduino.app. From there you can Navigate to Tools > Board > HexBright.

Block Image

Linux ¶ 

To determine where your default sketchbook location is follow the menu:

File->Preferences->"Sketchbook location". It normally defaults to: /home/<username>/sketchbook

In order for the Arduino IDE to find the boards.txt file, copy it to the following location (you will need to create the directory structure):

/home/<username>/sketchbook/hardware/Hexbright/boards.txt

If you use the system package for Arduino (ie Ubuntu repo), you may want to make this change system-wide. To do so, edit the system file and place the contents of this boards.txt file into the following:

/usr/share/arduino/hardware/arduino/boards.txt

Connecting and programming ¶ 

Now run the Arduino software. Under the Tools menu, set the board type to 'Hexbright'. If the hexbright option doesn't appear in the light, double-check that you put the boards.txt file in the correct place, in the previous section.

Block Image

Go to 'Tools'->'Serial Port', and look at the available ports. Plug your Hexbright Flex into your computer, wait a moment, and go to 'Tools'->'Serial Port' again. A new option should appear. Select that port.

Block Image

Try clicking the Serial Monitor button, on the top-right of the Arduino window. It should immediately connect to the Hexbright Flex and start displaying status messages. This step isn't necessary for programming, but it can be a useful tool for monitoring and debugging running programs. Close the Serial Monitor window when you're done.

Block Image

Finally, open up the source code for a program. You can download several different programs from our samples repository on GitHub.com, here. Read, modify, and improve the code as you please. The Verify button on the toolbar (checkmark on the left side) will compile the program, and report if there are any errors. The Upload button beside it will reprogram your Hexbright Flex with the new program. Try it out! You can always go back to the factory default by downloading, opening, and programming hexbright_factory.ino from the sample repository.

Block Image

Comments Comments are onturn off

On Mac OS X, I'm getting "avrdude: Expected signature for ATMEGA168 is 1E 95 14

Double check chip, or use -F to override this check."

I had to modify my avrdude.conf. Which should live in "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc"

I uncommented the following line in the ATmega168 sections of the avrdude.conf file.

signature = 0x1e 0x94 0x06;

and commented out

#signature = 0x1e 0x95 0x14;

David Bryan, · Reply

On linux, put boards.txt in ~/sketchbook/hardware/hexbright/boards.txt

You will also need to be in the uucp or tty group (usermod -a -G tty username).

David Hilton, · Reply

What's the usermod for? Connecting to the serial port?

On Ubuntu 12.04 LTS, even after that usermod, only if I run ./arduino as root does menu Tools / Serial Port show any entries (in particular, /dev/ttyUSB0 that my FLEX is plugged into). Then the Serial Monitor works as shown in this guide, and Verify and Upload work for the few github demos I tried.

Camille Goudeseune,

Where to put the board definitions file in a Mac OS X system? Also, how can I tell if the computer is recognizing the Hexflex? Thanks. (Or can you point me to more rudimentary instructions for non-programmers like me?) Thanks.

paul78746, · Reply

Sorry, disregard last post. Just stumbled onto the FAQs. I'll be back if I strike out. Thanks.

paul78746, · Reply

As superuser I placed the following in /etc/udev/rules.d/49-hexbright.rules so that upon USB connection the hexbright would automatically be connected (without needing to added to any groups or changing /dev/ttyUSB0 permissions):

SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789]?", MODE:="0666"

KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789]?", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1"

DaylanDarby, · Reply

One can use the Linux command 'screen /dev/ttyUSB0 9600' as an alternate to Arduino's serial monitor.

DaylanDarby, · Reply

If you are using Sublime Text on Linux or OS X, and you want to use the STino package for Arduino development, the the last 2 lines of the boards.txt file needs to be modified to be:

hexbright.build.core=arduino

hexbright.build.variant=standard

instead of

hexbright.build.core=arduino:arduino

hexbright.build.variant=arduino:standard

Rob Cordeau, · Reply

For Arduino 1.5 you need to put the boards.txt file in hardware/hexbright/avr/boards.txt

Tim Hutt, · Reply

You also need to add this line to boards.txt:

hexbright.upload.tool=avrdude

And copy platform.txt and programmers.txt from the arduino/avr folder in there.

Tim Hutt,

View Statistics:

Today: 7

This Week: 32

This Month: 192

All Time: 11,834