From 3124bb8bf10e4dec66517008f9cb3f39d1e80a89 Mon Sep 17 00:00:00 2001 From: redPanther Date: Sun, 4 Dec 2016 14:28:38 +0100 Subject: [PATCH] optimize adalight firmware (#308) --- assets/firmware/arduino/adalight/adalight.ino | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/assets/firmware/arduino/adalight/adalight.ino b/assets/firmware/arduino/adalight/adalight.ino index 6f8b0869..c9e6c1b0 100644 --- a/assets/firmware/arduino/adalight/adalight.ino +++ b/assets/firmware/arduino/adalight/adalight.ino @@ -9,12 +9,11 @@ set following values to your needs **************************************/ -// Number of leds in your strip. set to 1 and ANALOG_OUTPUT_ENABLED to true to activate analog only +// Number of leds in your strip. set to "1" and ANALOG_OUTPUT_ENABLED to "true" to activate analog only #define NUM_LEDS 100 - -#define SPI_LEDS false // connection type. Set "true" for 4 wire and "false" for 3 Wire stripes. -#define LED_TYPE WS2812B // type of your led controller, possible values, see below +// type of your led controller, possible values, see below +#define LED_TYPE WS2812B // 3 wire (pwm): NEOPIXEL BTM1829 TM1812 TM1809 TM1804 TM1803 UCS1903 UCS1903B UCS1904 UCS2903 WS2812 WS2852 // S2812B SK6812 SK6822 APA106 PL9823 WS2811 WS2813 APA104 WS2811_40 GW6205 GW6205_40 LPD1886 LPD1886_8BIT @@ -22,8 +21,10 @@ // For 3 wire led stripes line Neopixel/Ws2812, which have a data line, ground, and power, you just need to define DATA_PIN. // For led chipsets that are SPI based (four wires - data, clock, ground, and power), both defines DATA_PIN and CLOCK_PIN are needed -#define DATA_PIN 6 -#define CLOCK_PIN 13 + +// DATA_PIN, or DATA_PIN, CLOCK_PIN +#define LED_PINS 6 // 3 wire leds +//#define LED_PINS 6, 13 // 4 wire leds #define COLOR_ORDER GRB // colororder of the stripe, set RGB in hyperion @@ -33,7 +34,7 @@ // ATTENTION this pin config is default for atmega328 based arduinos, others might work to // if you have flickering analog leds this might be caused by unsynced pwm signals // try other pins is more or less the only thing that helps -#define ANALOG_OUTPUT_ENABLED true +#define ANALOG_OUTPUT_ENABLED false #define ANALOG_MODE ANALOG_MODE_LAST_LED // use ANALOG_MODE_AVERAGE or ANALOG_MODE_LAST_LED #define ANALOG_GROUND_PIN 8 // additional ground pin to make wiring a bit easier #define ANALOG_RED_PIN 9 @@ -48,7 +49,8 @@ #define BRIGHTNESS 255 // maximum brightness 0-255 #define DITHER_MODE BINARY_DITHER // BINARY_DITHER or DISABLE_DITHER #define COLOR_TEMPERATURE CRGB(255,255,255) // RGB value describing the color temperature -#define COLOR_CORRECTION CRGB(255,255,255) // RGB value describing the color correction +#define COLOR_CORRECTION TypicalLEDStrip // predefined fastled color correction +//#define COLOR_CORRECTION CRGB(255,255,255) // or RGB value describing the color correction // Baudrate, higher rate allows faster refresh rate and more LEDs (defined in /etc/boblight.conf) #define serialRate 460800 // use 115200 for ftdi based boards @@ -133,13 +135,9 @@ void setup() { } #if NUM_LEDS > 1 || ANALOG_OUTPUT_ENABLED == false - #if SPI_LEDS == true - FastLED.addLeds(leds, ledCount); - #else - FastLED.addLeds(leds, ledCount); - #endif + FastLED.addLeds(leds, ledCount); #endif - + // color adjustments FastLED.setBrightness ( BRIGHTNESS ); FastLED.setTemperature( COLOR_TEMPERATURE );