03-19-2018, 02:32 PM
Code I used
// We're updating 4x/second
void updateLEDs()
{
// Our things happen 4x/second
int time = (millis() % 1000) / 250;
// Right side counts down from 3 in binary
// Right Red is 2's on time 0 & 1
leds[LED_RIGHT_A].r = 0;
leds[LED_RIGHT_A].g = 0;
leds[LED_RIGHT_A].b = 0;
if (time < 2)
{
leds[LED_RIGHT_A].r = 255;
}
// Right Green is 1's on time 0 & 2
leds[LED_RIGHT_B].r = 0;
leds[LED_RIGHT_B].g = 0;
leds[LED_RIGHT_B].b = 0;
if (time == 0 || time == 2)
{
leds[LED_RIGHT_B].g = 255;
}
// Left & rear LED blinks red about 2hz, but slightly off of right side?
time = (millis() % 510) / 255;
leds[LED_REAR].r = 0;
leds[LED_REAR].g = 0;
leds[LED_REAR].b = 0;
leds[LED_LEFT].r = 0;
leds[LED_LEFT].g = 0;
leds[LED_LEFT].b = 0;
if (time == 0)
{
leds[LED_REAR].r = 255;
leds[LED_LEFT].r = 255;
}
// Front is Blue
leds[LED_FRONT].r = 0;
leds[LED_FRONT].g = 0;
leds[LED_FRONT].b = 255;
// Show our updates
FastLED.show();
}
// We're updating 4x/second
void updateLEDs()
{
// Our things happen 4x/second
int time = (millis() % 1000) / 250;
// Right side counts down from 3 in binary
// Right Red is 2's on time 0 & 1
leds[LED_RIGHT_A].r = 0;
leds[LED_RIGHT_A].g = 0;
leds[LED_RIGHT_A].b = 0;
if (time < 2)
{
leds[LED_RIGHT_A].r = 255;
}
// Right Green is 1's on time 0 & 2
leds[LED_RIGHT_B].r = 0;
leds[LED_RIGHT_B].g = 0;
leds[LED_RIGHT_B].b = 0;
if (time == 0 || time == 2)
{
leds[LED_RIGHT_B].g = 255;
}
// Left & rear LED blinks red about 2hz, but slightly off of right side?
time = (millis() % 510) / 255;
leds[LED_REAR].r = 0;
leds[LED_REAR].g = 0;
leds[LED_REAR].b = 0;
leds[LED_LEFT].r = 0;
leds[LED_LEFT].g = 0;
leds[LED_LEFT].b = 0;
if (time == 0)
{
leds[LED_REAR].r = 255;
leds[LED_LEFT].r = 255;
}
// Front is Blue
leds[LED_FRONT].r = 0;
leds[LED_FRONT].g = 0;
leds[LED_FRONT].b = 255;
// Show our updates
FastLED.show();
}