Hallo,
ist es möglich, dass man diese Funktionen erweitert, dass die
x-darauffolgenden Leds den gleichen Wert erhalten?
1 | void inline ws2812_setleds(struct cRGB *ledarray, uint16_t leds)
|
2 | {
|
3 | ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin));
|
4 | }
|
5 |
|
6 | void inline ws2812_setleds_pin(struct cRGB *ledarray, uint16_t leds, uint8_t pinmask)
|
7 | {
|
8 | ws2812_DDRREG |= pinmask; // Enable DDR
|
9 | ws2812_sendarray_mask((uint8_t*)ledarray,leds+leds+leds,pinmask);
|
10 | _delay_us(50);
|
11 | }
|
12 |
|
13 | void ws2812_sendarray(uint8_t *data,uint16_t datlen)
|
14 | {
|
15 | ws2812_sendarray
|
16 | ...
|
Quelle:
https://github.com/cpldcpu/light_ws2812/blob/master/light_ws2812_AVR/Light_WS2812/light_ws2812.c
Beispiel:
void inline ws2812_setleds(struct cRGB *ledarray, uint16_t leds,
uint16_t pairOfLeds);
#define NUM_LEDS 20
cRGB leds[NUM_LEDS];
ws2812_setleds(leds, 5, 4); // Leite die ersten 5 Werte weiter
// -> Der Wert 0 wird als neuer Wert 0, 1, 2, 3 und 4 interpretiert
// -> Der Wert 1 wird als neuer Wert 5, 6, 7, 8 und 9 interpretiert