diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2014-03-21 21:21:01 +0400 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2014-03-21 21:21:01 +0400 |
commit | 3a13da215264b4c79991a2b3c8e692d2e4f4e024 (patch) | |
tree | 17cd4fc787c583629df22f507620715aff6cb15e | |
parent | ae4f4357bef65b1a9ee0e7ecf6a0b92742f5a172 (diff) |
Add global setDither/setTemp/setCorrection methods - this will propagate the cahnge to all the controllers.
-rw-r--r-- | FastLED.cpp | 25 | ||||
-rw-r--r-- | FastLED.h | 4 |
2 files changed, 29 insertions, 0 deletions
diff --git a/FastLED.cpp b/FastLED.cpp index 2b5d7698..30b31cf2 100644 --- a/FastLED.cpp +++ b/FastLED.cpp @@ -66,3 +66,28 @@ void CFastLED::delay(unsigned long ms) { unsigned long start = millis(); while((millis()-start) < ms) { show(); } } + +void CFastLED::setTemperature(const struct CRGB & temp) { + CLEDController *pCur = CLEDController::head(); + while(pCur) { + pCur->setTemperature(temp); + pCur = pCur->next(); + } +} + +void CFastLED::setCorrection(const struct CRGB & correction) { + CLEDController *pCur = CLEDController::head(); + while(pCur) { + pCur->setCorrection(correction); + pCur = pCur->next(); + } +} + +void CFastLED::setDither(uint8_t ditherMode) { + CLEDController *pCur = CLEDController::head(); + while(pCur) { + pCur->setDither(ditherMode); + pCur = pCur->next(); + } +} + @@ -180,6 +180,10 @@ public: void delay(unsigned long ms); + void setTemperature(const struct CRGB & temp); + void setCorrection(const struct CRGB & correction); + void setDither(uint8_t ditherMode = BINARY_DITHER); + }; extern CFastLED & FastSPI_LED; |