// LED and Speaker Control for Arduino Uno
// Define the pin for the LED
const int ledPin = 13;
// Define the pin for the Speaker
const int speakerPin = 9;
void setup() {
// Set the LED pin as an output
pinMode(ledPin, OUTPUT);
// Set the Speaker pin as an output
pinMode(speakerPin, OUTPUT);
}
void loop() {
// Turn on the LED
digitalWrite(ledPin, HIGH);
// Turn on the Speaker
tone(speakerPin, 1000); // You can adjust the frequency for the desired tone
// Wait for 1 second
delay(1000);
// Turn off the LED
digitalWrite(ledPin, LOW);
// Turn off the Speaker
noTone(speakerPin);
// Wait for 1 second
delay(1000);
}