GithubHelp home page GithubHelp logo

tele-share / ambilight Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michaelficarra/ambilight

1.0 1.0 0.0 74 KB

ambilight clone for your arduino and some WS2801s using boblight

Home Page: http://michaelficarra.github.com/ambilight

ambilight's Introduction

This is a small project for creating an ambilight clone using an Arduino, a string of LEDs and WS2801s, and boblight. Installation instructions are provided for the Arduino Uno and Fedora 16, though they won't likely differ much for any Arduino/Unix-like combination.

Parts List

Installation

Make sure you have a libraries directory in the directory configured as your sketchbook in your arduino preferences.

SKETCHBOOK_PATH=$(grep ^sketchbook.path ~/.arduino/preferences.txt | cut -d = -f 2)
mkdir -p "$SKETCHBOOK_PATH/libraries"

Make sure you have the SPI library installed.

cd /tmp
git clone git://github.com/arduino/Arduino.git arduino
mv arduino/libraries/SPI "$SKETCHBOOK_PATH/libraries"
rm -rf arduino

Get the WS2801 library.

cd "$SKETCHBOOK_PATH/libraries"
git clone git://github.com/adafruit/WS2801-Library.git WS2801

Clone this project.

cd "$SKETCHBOOK_PATH"
git clone git://github.com/michaelficarra/ambilight.git ambilight

Boblight requires libavcodec. The Fedora build of ffmpeg didn't seem to come with libavcodec, so we'll have to get it ourselves.

cd /tmp
wget http://libav.org/releases/libav-0.7.3.tar.gz -O - | tar xz
cd libav-0.7.3
./configure && make && sudo make install

Download and install boblight.

cd /tmp
svn checkout http://boblight.googlecode.com/svn/trunk/ boblight
cd boblight
./configure && make && sudo make install

Install the boblight configuration file.

sudo cp "$SKETCHBOOK_PATH/ambilight/boblight.conf" /etc/

In the ardruino software, File -> sketchbook -> ambilight. Configure the dataPin, clockPin, stripLength, serialRate, and prefix values. Ctrl-u to compile and upload to your Arduino. Unplug your Arduino and attach the LED strip to your Arduino as in the following pictures.

connection to Arduino

connection to WS2801

WS2801 pins: from top to bottom: data, clock, ground, +5V

Configuration

There's a few configurable values in ambilight.ino.

  1. dataPin: the number of the Arduino pin connected to the WS2801 data pin
  2. clockPin: the number of the Arduino pin connected to the WS2801 clock pin
  3. stripLength: the number of WS2801-LED pairs, must be greater than zero
  4. serialRate: rate value from [device] section of /etc/boblight.conf
  5. prefix: prefix value from [device] section of /etc/boblight.conf

/etc/boblight.conf has to be configured with the regions (boblight calls them "lights") that are sampled for each individual LED. Below is a diagram of my configuration.

boblight.conf setup, with image of light positions

Running

Connect the arduino to USB. The first LED should be red, indicating it is waiting for a client.

Start the boblight daemon with boblightd. To detach it, instead run nohup boblightd &>/dev/null &. boblight-x11 connects to the boblightd daemon and sends the screen image data. I pass in some options with -o.

boblight-X11 -s 127.0.0.1:19333 -o saturation=1.7 -o value=0.5 -o threshold=60

Again, nohup may be used to detach it.

ambilight's People

Contributors

michaelficarra avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.