//ARDUINO CODE FOR FLASING LED LIGHT WITH BUZZER FOR A RAIL ROAD CROSSING EFFECT
void setup(){
pinMode(13,OUTPUT); //pinMode for power output from The Arduino
pinMode(12,OUTPUT);
pinMode(11,OUTPUT);
}
void loop (){//STARTING A VOID LOOP
digitalWrite(13,HIGH);//digitaWrite(1)turns on the LED for the time period of 1 second.
delay(100);
digitalWrite(13,LOW);//digitalWrite(2) turns off the LED for the time period of 1 second.
delay(100);
digitalWrite(12,HIGH);//digitaWrite(3)turns on the LED for the time period of 1 second.
delay(100);
digitalWrite(12,LOW);//digitalWrite(4) turns off the LED for the time period of 1 second.
delay(100);
tone(11,1000);//tone is code when the the buzzer rings.
delay(25);
noTone(11);// noTone is the time period when the tone stops.
}
//[NOTE:The delay btw all the digitalwrites and Tone can be tweaked as per the use]
// This all the code Required for a FLASING LED LIGHT WITH BUZZER FOR A RAIL ROAD CROSSING EFFECT.
Comments