If you have basic knowledge of Java, it will be quite easy to create your own controller for your LED strip. This way you can customise your strips even further!

Development environment

It is advised to use an IDE like Eclipse for your development. Start of by creating a new project for your controller. You will have to add the LedController_vXXX.jar file to your classpath. To do so in Eclipse, you will have to configure the build path of your project.

Creating your controller

You start by defining a new class which extends upon the Controller class. You should put this class in your own package, not inside the nl.kevinjilissen.ledcontroller.controller package. In the constructor of your class you have to pass the instance of the LEDStrip class to the constructor of the super class. You also have to override the public void update(double dms) method in order to make your controller actually do something.

Example

A basic example controller sliding RGB colors from the start to the end can be found below:


	
package nl.kevinjilissen.ledcontroller.controller;

import nl.kevinjilissen.ledcontroller.LEDStrip;
import nl.kevinjilissen.ledcontroller.controller.Controller;

public class RGBTest extends Controller {

    public static final byte B0 = (byte) 0x00;
    public static final byte B255 = (byte) 0xFF;

    private double time = 0.0;
    private int lastI = 0;

    public RGBTest(LEDStrip strip) {
        super(strip);
    }

    @Override
    public void update(double dms) {
        LEDStrip strip = getStrip();
        int l = strip.getLength();

        // Move 1 pixel every 100 milliseconds.
        time += dms / 100.0;
        time %= (double) l;

        int i = (int) Math.floor(time);
        if (i != lastI) { // Only update when index has changed.
            lastI = i;
            if (i == 0) {
                strip.setColor(l - 3, B0, B0, B0);
                strip.setColor(l - 2, B0, B0, B255);
                strip.setColor(l - 1, B0, B255, B0);
                strip.setColor(0, B255, B0, B0);
            } else if (i == 1) {
                strip.setColor(l - 2, B0, B0, B0);
                strip.setColor(l - 1, B0, B0, B255);
                strip.setColor(0, B0, B255, B0);
                strip.setColor(1, B255, B0, B0);
            } else if (i == 2) {
                strip.setColor(l - 1, B0, B0, B0);
                strip.setColor(0, B0, B0, B255);
                strip.setColor(1, B0, B255, B0);
                strip.setColor(2, B255, B0, B0);
            } else {
                strip.setColor(i - 3, B0, B0, B0);
                strip.setColor(i - 2, B0, B0, B255);
                strip.setColor(i - 1, B0, B255, B0);
                strip.setColor(i, B255, B0, B0);
            }
        }
    }

    @Override
    public boolean isMultiColor() {
        return true;
    }
}

The result of this example controller will look like this: RGBTest

Inserting in the program

After you have compiled your controller, you have to put the .class file of your controller inside the controllers directory of your LedController installation directory. The program will automatically load your controller on startup.

Javadoc

Last but definitely not least, you can find the javadoc of this software here. The javadoc will always be updated to the latest version of the software. If you are using an older version, consider updating to the latest version.