Is it possible to add a piezo buzzer to a counter:
my example:
(countD<70)
so 1 melody at =0 2nd melody 10,20,30,40,50,60 3rd melody 70
This is what I was playing around with:
if (countD=0)
buzz(2, 2500, 500);
++counter;
putting into this:
if (countD<70)
{
if (countB<10) {
digitalWrite(ledArray2[countB],LOW);
}
if (++countB>=10) countB=0; // For some reason changing this from 20 to 10 makes array not long pause
if (countB<10) {
digitalWrite(ledArray2[countB],HIGH);
}
countD++;
}
}
}
}
Any ideas if its possible?, Im sure it is but I cant find any documentation to help me.
so does this look okay?? 2500, 4000, 6000 I assume is the pitch or tone? so we get one melody for 0 and the second melody from 10-60 third dif melody on 70
if (countD<70)
if((countD) == 0) buzz(2, 2500, 500);
if((countD % 10) == 10 - 60) buzz(2, 4000, 500);
if((countD % 10) == 70) buzz(2, 6000, 500);
{
if (countB<10) {
Edit 2:
void buzz()
{
if(((countD % 10) == 0)) && ((countD > 10) && (countD < 70)))
{
buzz(2, 4000, 500);
}
else if((countD % 70) == 0)
{
buzz(2, 6000, 500);
}}