buffer is filled with expected color
This commit is contained in:
parent
d5986470fe
commit
2790a62175
@ -126,10 +126,11 @@ public class ESP8266Ws2812 extends TwoArgFunction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Varargs invoke(Varargs varargs) {
|
public Varargs invoke(Varargs varargs) {
|
||||||
if (varargs.narg() >= 3) {
|
if (varargs.narg() == 4) {
|
||||||
final int red = varargs.arg(1).toint();
|
/* first argument is the object itself */
|
||||||
final int green = varargs.arg(2).toint();
|
final int red = varargs.arg(2).toint();
|
||||||
final int blue = varargs.arg(3).toint();
|
final int green = varargs.arg(3).toint();
|
||||||
|
final int blue = varargs.arg(4).toint();
|
||||||
/* update local buffer */
|
/* update local buffer */
|
||||||
for(int i=0; i < ledList.size(); i++) {
|
for(int i=0; i < ledList.size(); i++) {
|
||||||
ledList.set(i, new Color(red, green, blue));
|
ledList.set(i, new Color(red, green, blue));
|
||||||
|
Loading…
Reference in New Issue
Block a user