Intro to Programming
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.
- Windows XP, Windows Server, Windows Vista, Windows 7, Windows 8
- Windows 2000
- Mac OSX
- Linux (Most modern distributions do not require this step, as the driver was merged with the kernel in 2005. However, you will need to be in the right groups, which vary from distro to distro.)
(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.
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...)
This file should be put in: <Sketches>\Hard
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.
To determine where your default sketchbook location is follow the menu:
File->Preferences->"Sketchbook location". It normally defaults to: /home/<username
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):
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:
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.
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.
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.
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_facto