Skip to content
q-rai edited this page May 27, 2012 · 4 revisions

About the MoodLightUSB

The MoodLightUSB is a small device that is powered and steered via USB. It uses four RGB LEDs, resulting in bright light within a wide range of colours.

Credits:

  • The MoodLightUSB board is based on the Micropendous project
  • USB on the device is powered by LUFA
  • Steering is done using HidCom

HowTo

Overview

  1. Get hold of a MoodLight kit (ask me or make one yourself) Be aware: v2.0 is buggy! You need to add a crystal and two capacitors afterwards (quite fiddly), so you'll probably want to use v1.0 or wait for v2.5.
  2. Solder it - if you're not well-accustomed to SMD soldering, I recommend using solder paste since it's way easier to use than regular solder. If you use regular solder, it should be thin. In case you've never soldered at all, this probably isn't an appropriate first project.
  3. Flash it with the device software found in src/moodlightDevice
  4. Steer it using the host software found in src/moodlightHost
  5. Have fun with it!

Device Software

Compiling the device software is simply done using make. You'll have to have the avrgcc installed.

In order to flash the device, you first need to start the flashing mode: Hold the HWB button while pushing RESET. Then you can flash the device using the dfu-programmer (version 1.5.2 or higher) by first erasing the current software and then flashing the new software.

[sudo] dfu-programmer atmega32u2 erase

[sudo] dfu-programmer atmega32u2 flash Moodlight.hex

Host Software

In order to steer the moodlight, you need to compile the host software. This is easily done using

gcc HidCom.c -o HidCom

Then, you can steer the moodlight using

[sudo] ./HidCom -s8 -d5 rr gg bb mm tt

where

  • rrggbb is the RGB hex code
  • mm is the mode (00 glow, 01 blink, 02 fade, ff demo)
  • tt is the time. For glowing, it's measured in seconds, for the other modes, it's measured in rounds.

Lincense

Clone this wiki locally