// Define the pin assignment for LED0
const int LED_PIN = 2; // Assuming LED0 is connected to digital pin 13
// Variable to store the state of LED0
bool LED0_state = false;
// Function to toggle LED0 state
void toggle_LED0_state() {
LED0_state = !LED0_state; // Toggle the state
digitalWrite(LED_PIN, LED0_state); // Set the pin state accordingly
}
void setup() {
pinMode(LED_PIN, OUTPUT); // Set LED pin as output
}
void loop() {
// Call the function to toggle LED0 state
toggle_LED0_state();
// Print a message indicating the current state of LED0
if (LED0_state) {
Serial.println("LED0 is ON");
} else {
Serial.println("LED0 is OFF");
}
delay(1000); // Wait for 1 second
}