forked from pauly7300/testingpm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpixel.h
18 lines (11 loc) · 826 Bytes
/
pixel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef PIXEL_H
#define PIXEL_H
void pixel() {
// Persistent local variable
static uint16_t currLED; // Persistent local value to count the current LED location.
timeval = 0; // Our EVERY_N_MILLIS_I timer value.
currLED = (currLED+1) % (NUM_LEDS); // Cycle through all the LED's. By Andrew Tuline.
CRGB newcolour = ColorFromPalette(currentPalette, oldsample, oldsample, currentBlending); // Colour of the LED will be based on oldsample, while brightness is based on sampleavg.
nblend(leds[currLED], newcolour, 192); // Blend the old value and the new value for a gradual transitioning.
} // pixel()
#endif