I'm currently working on a slot machine for my Arduino, and one of the things I want to happen, is that when the user "pulls" the lever, a dinging sound can be heard, that slows down as time passes.
This is what I have so far, but I can't figure out how to make the delay variable with a countdown.
void ringading(){
for (int i=10; i>10; i--)
{
for (int i=0; i<500; i++)
{
digitalWrite(BUZZER_PIN, HIGH);
delayMicroseconds(1915);
digitalWrite(BUZZER_PIN, LOW);
}
delay(1000);
}
}
This is probably not the best way to do this, but I know it buzzes 10 times now, each with a one second delay in between. So I basically just need to get that delay to increase.