The HexBright (or HexBright Flex) is an open-source, programmable LED flashlight from a 2011 Kickstarter project. It's designed with an onboard ATmega328P microcontroller that's fully Arduino-compatible, meaning you don't need to "connect" a separate Arduino board to it—the flashlight is an Arduino. You program it directly via USB using the Arduino IDE, just like any Arduino Uno. It features a high-output CREE LED (up to 500 lumens), a built-in accelerometer for tilt-based controls, a button for input, thermal sensing to prevent overheating, and USB charging.

If you're trying to interface an external Arduino with the HexBright (e.g., via wires for custom control), that's possible but uncommon—let me know more details for specifics. Assuming you're looking to program or customize the HexBright itself, here's a step-by-step guide based on the official resources and community projects.

Hardware Overview

Setting Up the Arduino IDE for HexBright

  1. Download Arduino IDE: Get the latest version from arduino.cc. Version 1.0.1+ is required for compatibility, but newer ones work fine.

  2. Install the HexBright Board Definition:

    Example boards.txt content (for reference):

    #####################################################
    HexBright.name=HexBright
    
    hexbright.upload.protocol=arduino
    hexbright.upload.maximum_size=30720
    hexbright.upload.speed=57600
    hexbright.upload.tool=avrdude
    hexbright.upload.verbose=true
    
    hexbright.bootloader.low_fuses=0xff
    hexbright.bootloader.high_fuses=0xde
    hexbright.bootloader.extended_fuses=0x05
    hexbright.bootloader.path=hexbright
    hexbright.bootloader.file=ATmegaBOOT_168_atmega328.hex
    hexbright.bootloader.unlock_bits=0x3F
    hexbright.bootloader.lock_bits=0x0F
    
    hexbright.build.mcu=atmega328p
    hexbright.build.f_cpu=16000000L
    hexbright.build.core=arduino
    hexbright.build.vid=0x2341
    hexbright.build.pid=0x8036
    hexbright.build.usb_product="HexBright Flex"
    hexbright.build.usb_manufacturer="HexBright"
    hexbright.build.board=AVR_HEXBRIGHT
    hexbright.build.verbose=true
    
    
  3. Install USB Driver (Windows/Mac):

  4. Verify Connection:

Recommended Libraries and Sample Code

The community-maintained hexbright library simplifies hardware access (e.g., reading the accelerometer, setting PWM brightness).

Key library functions (from hexbright.h):