subodh_pai
Published

Rail road crossing Effect ( LED and Buzzer)

This is a project in which you will have a railroad crossing effect by using 2 leds and a buzzer.

BeginnerProtip516
Rail road crossing Effect ( LED and Buzzer)

Things used in this project

Story

Read more

Schematics

1641054106589_OqLYrr5GYK.jpg

Code

ARDUINO_CODE_FOR_FLASING_LED_LIGHT_WITH_BUZZER_FOR_A_RAIL_ROAD_.ino

Arduino
//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.

Credits

subodh_pai
2 projects • 0 followers

Comments