four led
const int RedPin = 13;
const int BluePin = 12;
const int YellowPin = 11;
const int GreenPin = 10;
void setup() {
// put your setup code here, to run once:
pinMode(RedPin, OUTPUT);
pinMode(BluePin, OUTPUT);
pinMode(YellowPin, OUTPUT);
pinMode(GreenPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
for (int i = 0; i < 10; i++)
{
if (i%2 == 0)
{
digitalWrite(11, LOW); // YellowPin
digitalWrite(13, LOW); // RedPin
digitalWrite(10, HIGH); // GreenPin
digitalWrite(12, HIGH); // BluePin
delay(1000); // 1 seconds
}
else
{
digitalWrite(10, LOW); // YellowPin
digitalWrite(12, LOW); // RedPin
digitalWrite(11, HIGH); // GreenPin
digitalWrite(13, HIGH); // BluePin
delay(1000); // 1 seconds
}
}
}