Skip to content

Commit da1e9fe

Browse files
authored
Update digispark.ino
rgb[] array is not correctly indexed inside setPixel() function
1 parent 684c36a commit da1e9fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

digistump-avr/libraries/WS2811/examples/digispark/digispark.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ void loop() {
1414
}
1515

1616
void setPixel(i,r,g,b){
17-
rgb[r].r=r;
18-
rgb[g].g=g;
19-
rgb[b].b=b;
17+
rgb[i].r=r;
18+
rgb[i].g=g;
19+
rgb[i].b=b;
2020
}
2121

2222
void updatePixels(){
2323
WS2811RGB(rgb, ARRAYLEN(rgb));
24-
}
24+
}

0 commit comments

Comments
 (0)