Hey guys i am having problems with a siren sketch , i am getting the sketch from a book called 'Sain Smart' and when i finnished typing the sketch in and then upload it to my Uno, i get an error message "expected '{' before '{'" and i dont really know how to fix this issue.
i coppied the sketch down to the letter, here is the sketch . . .
/*
Siren:
Frequency ramps up and down
on the passive buzzer for a
set number of times (the outer
"for" statement).
*/
int passiveBuzPin = 7;
int i = 0;
int numOfLoops = 0;
int noteDuration = 1000/3; // an eight not
int pauseBetweenNotes = noteDuration * 0.2;
void setup(){
// This nuter for statement determines the number
//of siren cycles that are played,
for{numOfLoops =0; numOfLoops < 4; numOfLoops++) {
//Plays low to high frequencies
for{i=25;i<120;i++){
tone{PassiveBuzPin, 20i, noteDuration}
delay {pauseBetweenNotes};
}
//play high to low frequencies
for{i=120;i>=25;i--}[
tone {passiveBuzPin, 20i, noteDuration};
delay{pauseBetweenNotes};
}
}
}
void loop (){
}
I hope you guys can help me with this issue