Programming Examples

Arduino program to interface led buzzer with Arduino or raspberry pi and turn ON LED for 2 second after every 3 second




Arduino program to interface led/buzzer with Arduino /raspberry pi and turn ON LED for 2 second after every 3 second

// Pin connected to the LED
const int ledPin = 13;
void setup() {
  // Set the LED pin as an output
  pinMode(ledPin, OUTPUT);
}
void loop() {
  // Turn the LED ON
  digitalWrite(ledPin, HIGH);
  
  // Wait for 2 seconds
  delay(2000);
  
  // Turn the LED OFF
  digitalWrite(ledPin, LOW);
  
  // Wait for 3 second 
  delay(3000);
}
Output/ Explanation:

Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad