Skip to content

Commit

Permalink
LED count XXL
Browse files Browse the repository at this point in the history
  • Loading branch information
bracci committed Jan 17, 2016
1 parent 7838364 commit 6de2af4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
// #define LED_DRIVER_DOTSTAR
#define LED_DRIVER_LPD8806

#ifdef LED_DRIVER_LPD8806
#if defined(LED_DRIVER_LPD8806) || defined(LED_DRIVER_NEOPIXEL)
//#define MATRIX_XXL
#endif

Expand Down
1 change: 1 addition & 0 deletions LedDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "MyRTC.h"
#include "Transitions.h"
#include "Modes.h"
#include "Configuration.h"

extern volatile byte helperSeconds;
extern Mode mode;
Expand Down
2 changes: 1 addition & 1 deletion LedDriverLPD8806.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

// eigentlich haben wir ja 115 LEDs, aber LPD8806 sind ja immer zweier...
#ifdef MATRIX_XXL
#define NUM_PIXEL 228
#define NUM_PIXEL 230
#else
#define NUM_PIXEL 130
#endif
Expand Down
37 changes: 34 additions & 3 deletions LedDriverNeoPixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#include "Debug.h"

#ifdef MATRIX_XXL
#define NUM_PIXEL 228
#define NUM_PIXEL 225
#else
#define NUM_PIXEL 114
#define NUM_PIXEL 115
#endif

/**
Expand Down Expand Up @@ -337,6 +337,35 @@ void LedDriverNeoPixel::_setPixel(byte x, byte y, uint32_t c) {
* Einen Pixel im Streifen setzten (die Eck-LEDs sind am Ende).
*/
void LedDriverNeoPixel::_setPixel(byte num, uint32_t c) {
#ifdef MATRIX_XXL
if (num < 110) {
if ((num / 11) % 2 == 0) {
_strip->setPixelColor(num * 2, c);
_strip->setPixelColor(num * 2 + 1, c);
} else {
_strip->setPixelColor(((num / 11) * 22) + 21 - ((num % 11) * 2), c);
_strip->setPixelColor(((num / 11) * 22) + 20 - ((num % 11) * 2), c);
}
} else {
switch (num) {
case 110:
_strip->setPixelColor(221, c);
break;
case 111:
_strip->setPixelColor(222, c);
break;
case 112:
_strip->setPixelColor(223, c);
break;
case 113:
_strip->setPixelColor(220, c);
break;
case 114:
_strip->setPixelColor(224, c);
break;
}
}
#else
if (num < 110) {
if ((num / 11) % 2 == 0) {
_strip->setPixelColor(num, c);
Expand All @@ -358,10 +387,11 @@ void LedDriverNeoPixel::_setPixel(byte num, uint32_t c) {
_strip->setPixelColor(110, c);
break;
case 114: // die Alarm-LED
_strip->setPixelColor(110, c);
_strip->setPixelColor(114, c);
break;
}
}
#endif
}

/**
Expand All @@ -386,3 +416,4 @@ uint32_t LedDriverNeoPixel::_wheel(byte brightness, byte wheelPos) {
byte LedDriverNeoPixel::_brightnessScaleColor(byte brightness, byte colorPart) {
return map(brightness, 0, 100, 0, colorPart);
}

0 comments on commit 6de2af4

Please sign in to comment.