Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Arduino Ambilight on MacBook Pro

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,274
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jan 9, 2010

A very simple hack using lowpass filters on the VGA color signals and an Arduino that generates PWM from the filtered signals driving an IKEA "Dioder" LED strip.

Category:

Entertainment

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (MeierUTube)

  • Do you have an email where we coulf talk about your project.

  • @torresfelipe Sure. Send me a personal message with your e-mail address and I will reply to that address.

  • Code, Part 6 (last part): // calculate the average: average[i] = total[i] / numReadings; // Set the LED color delay(3); analogWrite(outputPin[i], average[i]); }

    }

  • Code, Part 5: // add the reading to the total: total[i] = total[i] + readings[i][index]; // advance to the next position in the array: index = index + 1; // if we're at the end of the array... if (index >= numReadings) // ...wrap around to the beginning: index = 0;

  • Code, Part 3:

    // Averaging

    int readings[3][numReadings]; // the readings from the analog input

    int index = 0; // the index of the current reading

    int total[3] = {0, 0, 0}; // the running total

    int average[3] = {0, 0, 0}; // the average

  • Code, Part 4:

    void setup() {

    }

    void loop() { // read the analog in values: for (int i = 0; i <= 2; i++) { // subtract the last reading: total[i] = total[i] - readings[i][index]; // read from the sensor: readings[i][index] = analogRead(inputPin[i]); // Correct maximum if necessary rangeMax = min(max(readings[i][index], rangeMax), maxMax); readings[i][index] = map(min(max(rangeMin, readings[i][index]), rangeMax), rangeMin, rangeMax, 0, 255);

see all

All Comments (19)

Sign In or Sign Up now to post a comment!
  • Great work man, easy enough perhaps but still a really great project!

  • @MeierUTube Thanks for help I will try to make something similar. I will publish the result when it will be done and let You know about it. Thanks again. Cheers! :D

  • Code, Part 2:

    // Constants

    const int numReadings = 10;

    int rangeMin = 0; // Range of the ADC values

    int rangeMax = 255; // Range of the ADC values

    int maxMax = 1023;

    // Pins and Values

    int inputPin[3] = {0, 1, 2};

    int outputPin[3] = {9, 10, 11};

  • Code, Part 1:

    /* VGA Ambilight Reads 3 analog input pins, maps the result to a range from 0 to 255 and uses the result to set the pulsewidth modulation (PWM) of 3 output pins. The circuit: * Analog inputs on pins 0/1/2. * PWM ouputs on pins 9/10/11 created 1/7/2010 by Roger Meier */

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more