Modification des couleurs, de la luminosité et clignotement de leds RGB.
#include <avrio/delay.h>
#include <avrio/led.h>
#include <avrio/ledrgb.h>
#include <avr/pgmspace.h>
#define COLOR_LIST_SIZE 16
static const uint32_t ulColorList[COLOR_LIST_SIZE] PROGMEM = {
RGB_BLACK,
RGB_WHITE,
RGB_RED,
RGB_LIME,
RGB_BLUE,
RGB_YELLOW,
RGB_CYAN,
RGB_MAGENTA,
RGB_SILVER,
RGB_GRAY,
RGB_MAROON,
RGB_OLIVE,
RGB_GREEN,
RGB_PURPLE,
RGB_TEAL,
RGB_NAVY
};
static void
vAssert (bool test) {
if (test == false) {
for (;;) {
}
}
}
static void
uint32_t ulColor;
if (bNone)
xLed = 1;
for (uint8_t ucColor = 0; ucColor < COLOR_LIST_SIZE; ucColor++) {
memcpy_P (&ulColor, &ulColorList[ucColor], sizeof(uint32_t));
if (bNone)
xLed <<= 1;
}
}
int
main (void) {
for (;;) {
xLed = 1;
while (xLed) {
vTestLeds (xLed);
xLed <<= 1;
}
vTestLeds (0);
for (uint8_t ucDimming = 0; ucDimming < 255; ucDimming++) {
}
}
return 0;
}