|
|
|
|
@ -289,16 +289,18 @@ void loop()
|
|
|
|
|
digitalWrite(LED_BUILTIN, (timeNow % 2000) < 1000);
|
|
|
|
|
Receive();
|
|
|
|
|
Nunchuk_control();
|
|
|
|
|
|
|
|
|
|
strip.clear();
|
|
|
|
|
strip.setPixelColor(idx_led, strip.Color(128, 0, 0));
|
|
|
|
|
strip.setPixelColor((NB_STRIP * LED_STRIP) - 1 - idx_led, strip.Color(128, 0, 0)); // second LEDs strip
|
|
|
|
|
strip.show();
|
|
|
|
|
if (iTimeSend > timeNow)
|
|
|
|
|
return;
|
|
|
|
|
if (cmd2 == 0)
|
|
|
|
|
return;
|
|
|
|
|
iTimeSend = timeNow + ((200 - abs(cmd2)) * 2); // TIME_SEND
|
|
|
|
|
strip.clear();
|
|
|
|
|
strip.setPixelColor(idx_led, strip.Color(128, 0, 0));
|
|
|
|
|
if (cmd2 > 0){
|
|
|
|
|
if (idx_led < strip.numPixels() -1 )
|
|
|
|
|
if (cmd2 > 0)
|
|
|
|
|
{
|
|
|
|
|
if (idx_led < LED_STRIP - 1)
|
|
|
|
|
{
|
|
|
|
|
idx_led++;
|
|
|
|
|
}
|
|
|
|
|
@ -315,8 +317,7 @@ void loop()
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
idx_led = strip.numPixels() -1 ;
|
|
|
|
|
idx_led = LED_STRIP - 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
strip.show();
|
|
|
|
|
}
|
|
|
|
|
|