Comments: LilyPad ProtoSnap Plus Activity Guide

Pages

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • SteveEB / about 2 years ago / 1

    Regarding section 3: Custom Color Mixing, one way to walk through the color wheel using flexible intensity levels is to use a maximum intensity parameter and an intensity factor array.

    Step 1: Set up channels for each color.

    const int redChannel = 1; const int greenChannel = 2; const int blueChannel = 3;

    Step 2: Establish the intensity factor array to help walk through the wheel. Each color will start from a different index of the array.

    const float wheel_intensity_factor[12] = {0, 0, 0, 0, 0, 0.5, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5};

    Step 3: Establish starting points for the colors using an array index for each color. Here we start with pure red. We will wrap these back to zero as we move through the colors of the wheel one color at a time.

    int redIndex = 8; int greenIndex = 0; int blueIndex = 4;

    Step 4: Set the maximum intensity for each color. Some colors like red tend to be stronger for the same intensity level so we can reduce its maximum intensity. You can play with these colors to get them as close as you can to the wheel colors as you can for your set up.

    const int redMaxIntensity = 60; const int greenMaxIntensity = 120; const int blueMaxIntensity = 90;

    Step 5: Establish a final intensity color that is the product of the maximum intensity multiplied by the array factor, thus allowing us to step through the wheel colors using an 8-bit intensity value. I used this on a DMX512 system that only supported 8-bit intensity values. I started with an intensity of zero in this example.

    uint8_t redIntensity = 0; uint8_t greenIntensity = 0; uint8_t blueIntensity = 0;


If you've found an issue with this tutorial content, please send us your feedback!