Hey guys,
I'm working on a project where I need to play 4 buzzers simultaneously, each one with a different frequency. However, using tone() you can only have one buzzer working at a time. Any solution to this?
Ideally it would have to be something like this:
int buz1 =8;
int buz2 =9;
int buz3 =10;
int buz4 =11;
int button=A0;
int var_button;
void setup() {
pinMode(buz1,OUTPUT);
pinMode(buz2,OUTPUT);
pinMode(buz3,OUTPUT);
pinMode(buz4,OUTPUT);
pinMode(button,INPUT);
}
void loop() {
var_button=digitalRead(button);
if (var_button==HIGH){
tone(buz1, 523, 1);
tone(buz2, 659, 1);
tone(buz3, 784, 1);
tone(buz4, 988, 1);
}
}
however, this doesn't work because of the tone() restrictions, so it only activates the first buzzer.
Any help wold be appreciated