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

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad