const int ledPin = 8; // Pin for the LED
const int buzzerPin = 9; // Pin for the Buzzer
String string_1 = "cv dasAnjcdbsjlV";
void setup() {
// Initialize the LED pin as an output
pinMode(ledPin, OUTPUT);
// Initialize the Buzzer pin as an output
pinMode(buzzerPin, OUTPUT);
}
void loop() {
// Iterate over each character in the string
for (int i = 0; i < string_1.length(); i++) {
char c = string_1[i];
// Check if the character is a capital letter
if (isUpperCase(c)) {
// Blink the LED once
digitalWrite(ledPin, HIGH); // Turn the LED on
delay(200); // Wait for 200 milliseconds
digitalWrite(ledPin, LOW); // Turn the LED off
// Wait for 300 milliseconds before activating the buzzer
delay(300);
// Activate the buzzer
digitalWrite(buzzerPin, HIGH); // Turn the buzzer on
delay(300); // Buzzer on for 300 milliseconds
digitalWrite(buzzerPin, LOW); // Turn the buzzer off
}
}
// Add a delay before looping again
delay(1000); // Wait for 1 second before repeating the loop
}
// Function to check if a character is an uppercase letter
bool isUpperCase(char c) {
return c >= 'A' && c <= 'Z';
}