I'm looking to run the buzzer when either IF statement is true. How would I code it?
void LongBuzz() // This function is outside the loop
{
digitalWrite(5, HIGH);
delay(2000);
digitalWrite(5, LOW);
}
void loop() {
if (accelerationX > 100 && accelerationX < 500)
{
LongBuzz(); // Run buzzer function
}
if (accelerationY > 100 && accelerationY < 500)
{
LongBuzz(); // Run buzzer function
}
}