#define WHITE_RIGHT_PIN 2 // Arduino Uno pin 2
#define WHITE_LEFT_PIN 10 // Arduino Uno pin 3
void setup() {
pinMode(WHITE_RIGHT_PIN, OUTPUT);
pinMode(WHITE_LEFT_PIN, OUTPUT);
// Turn off all LEDs initially
digitalWrite(WHITE_RIGHT_PIN, LOW);
digitalWrite(WHITE_LEFT_PIN, LOW);
// Startup animation for white LEDs
startupWhiteAnimation();
// Set all white LEDs to on after the animation
digitalWrite(WHITE_RIGHT_PIN, HIGH);
digitalWrite(WHITE_LEFT_PIN, HIGH);
}
void startupWhiteAnimation() {
// Gradually light up the white LEDs on both sides simultaneously
for (int i = 0; i <= 255; i += 5) {
analogWrite(WHITE_RIGHT_PIN, i);
analogWrite(WHITE_LEFT_PIN, i);
delay(50); // Adjust delay for desired animation speed
}
// Hold the brightness for a moment
delay(500);
// Gradually light down the white LEDs on both sides simultaneously
for (int i = 255; i >= 0; i -= 5) {
analogWrite(WHITE_RIGHT_PIN, i);
analogWrite(WHITE_LEFT_PIN, i);
delay(50); // Adjust delay for desired animation speed
}
// Gradually light up to full brightness on both sides simultaneously
//for (int i = 0; i <= 255; i += 5) {
//analogWrite(WHITE_RIGHT_PIN, i);
//analogWrite(WHITE_LEFT_PIN, i);
//delay(50); // Adjust delay for desired animation speed
// }
}
void loop() {
// Main loop can be used for other tasks
}