This is the easiest way to get started with programming your hexbright.
Automatic overheat protection (adjustable in hexbright.h OVERHEAT_TEMPERATURE)
Automatic low-battery detection (no spontaneous power-offs if too much power is drawn)
All hardware management is done internal to the library; you can focus on firmware features, not implementation.
Multiple debug modes to help diagnose problems (DEBUG in hexbright.h)
Setting up your development environment (development environment setup, minus driver install).
- For linux: Most kernels come with the driver pre-built (it's been in the kernel since 2005 or so). However, many repositories do not yet have arduino 1.0.1 or higher, which is (currently) required. The tarballs available at arduino.cc are very easy to work with; I've been able to just extract the files and run arduino. You will probably have to fiddle with user groups, which vary by distro.
Download this folder/repository using one of the following methods, accessible at the top of the project page.
- Read-Only (no integrated sharing mechanism)
- Share your code
- Fork Click fork to generate your own copy of the project (requires a free account on github).
Open the arduino ide, and click on 'File'->'Preferences' in the menu.
Set your sketchbook location to the location of this folder (where this README file is found).
In arduino, click on 'Tools'->'Board'->'Hexbright' as your device type.
With your hexbright unplugged, go to 'Tools'->'Serial Port' and look at the options.
Now plug in your hexbright and go to 'Tools'->'Serial Port'. Select the new option. (On linux, there may be a delay of over a minute before the device appears.)
Underneath the 'Sketch' and 'Tools' menu options, there is an up arrow (to open a program). Click on it, go to 'programs', and select a program.
- I recommend tactical as your first program, as it is very straightforward.
- All firmwares in the programs directory have a readme describing their operation. Arduino doesn't have an integrated method of viewing associated files, so you will need to open README.md in the corresponding folder for notes on operation.
Under 'Edit', there is a right arrow. Click it to upload the program.
'temperature_calibration' is one of the simplest programs you could write.
'functional' is a basic example of how a program might have multiple modes.
'down_light' contains an example of using the accelerometer.
I have translated most of the original sample programs to the library here: https://github.com/dhiltonp/samples
Be aware that this library is a work in progress. In particular, the accelerometer api will change, and power consumption has not been optimized.