|
|
|
|
@ -294,16 +294,31 @@ void loop()
|
|
|
|
|
|
|
|
|
|
if (iTimeSend > timeNow)
|
|
|
|
|
return;
|
|
|
|
|
iTimeSend = timeNow + TIME_SEND;
|
|
|
|
|
if (cmd2 == 0)
|
|
|
|
|
return;
|
|
|
|
|
iTimeSend = timeNow + ((200 - abs(cmd2)) * 2); // TIME_SEND
|
|
|
|
|
strip.clear();
|
|
|
|
|
strip.setPixelColor(idx_led, strip.Color(128, 0, 0));
|
|
|
|
|
if (idx_led < strip.numPixels() -1 )
|
|
|
|
|
{
|
|
|
|
|
idx_led++;
|
|
|
|
|
if (cmd2 > 0){
|
|
|
|
|
if (idx_led < strip.numPixels() -1 )
|
|
|
|
|
{
|
|
|
|
|
idx_led++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
idx_led = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
idx_led = 0;
|
|
|
|
|
if (idx_led > 0 )
|
|
|
|
|
{
|
|
|
|
|
idx_led--;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
idx_led = strip.numPixels() -1 ;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
strip.show();
|
|
|
|
|
strip.show();
|
|
|
|
|
}
|
|
|
|
|
|