// Pin assignments
int Rled = 4;
int Gled = 8;
// Delay durations
int Rdelay = 100;
int Gdelay = 100;
int Ldelay = 2000;
// Number of blinks
int N_Rled = 1;
int N_Gled = 1;
void setup() {
pinMode(Rled, OUTPUT);
pinMode(Gled, OUTPUT);
Serial.begin(9600); // Initialize serial communication at 9600 bps
}
void loop() {
// Blink the red LED N_Rled times
for (int j = 0; j < N_Rled; j++) {
digitalWrite(Rled, HIGH); // Turn on the red LED
delay(Rdelay); // Wait for Rdelay milliseconds
digitalWrite(Rled, LOW); // Turn off the red LED
delay(Rdelay); // Wait for Rdelay milliseconds
}
// Blink the green LED N_Gled times
for (int j = 0; j < N_Gled; j++) {
digitalWrite(Gled, HIGH); // Turn on the green LED
delay(Gdelay); // Wait for Gdelay milliseconds
digitalWrite(Gled, LOW); // Turn off the green LED
delay(Gdelay); // Wait for Gdelay milliseconds
}
}