15 lines
417 B
C++
15 lines
417 B
C++
|
#include "effect_diamond.h"
|
||
|
#include "my_fastled.h"
|
||
|
|
||
|
void DiamondEffect::loop(uint16_t ms) {
|
||
|
for (int x=0; x<window->width; x++) {
|
||
|
for (int y=0; y<window->height; y++) {
|
||
|
uint8_t distance = abs(window->height/2 - y) + abs(window->width/2 - x);
|
||
|
CRGB col = CHSV(distance*8 - (millis()>>5)%255, 255, 255);
|
||
|
window->setPixel(x, y, &col);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
bool DiamondEffect::can_be_shown_with_clock() { return true; }
|