Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
558 B

  1. #if GARLAND_SUPPORT
  2. #include "../anim.h"
  3. #include "../palette.h"
  4. //------------------------------------------------------------------------------
  5. class AnimRandCyc : public Anim {
  6. public:
  7. AnimRandCyc() : Anim("RandCyc") {
  8. }
  9. void SetupImpl() override {
  10. for (int i = 0; i < numLeds; i++)
  11. seq[i] = rngb();
  12. }
  13. void Run() override {
  14. for (int i = 0; i < numLeds; i++) {
  15. leds[i] = palette->getCachedPalColor(seq[i]);
  16. seq[i] += rngb() >> 6;
  17. }
  18. }
  19. };
  20. #endif // GARLAND_SUPPORT