How do I use the following speaker with the Arduino?
http://www.dx.com/p/diy-arduino-buzzer-module-black-135036#.VOz3RETkfmE
Note that it has 3 pins.
I've tried giving it power (3.3 and 5 volts) by using the pin labeled "-" as ground, and the middle pin as the positive, I've then connected the "S" (which I'm assuming is "Signal") to pin 9 on the Arduino:
void setup() {
pinMode(9, OUTPUT);
Serial.begin(9600);
}
void loop() {
for(unsigned int i = 0; i < 20000; i += 500) {
tone(9, i);
Serial.print("debug: frequency: ");
Serial.println(i);
}
delay(500);
Serial.println("debug: finished sleeping");
}
I don't know what frequencies it can produce, so I tried all of them. I also tried with i++.
I've also tried some other simple programs that supposedly generate some tones, but I hear nothing in all cases.
Finally I tried giving it power just on a DC power supply, I tried again with "-" as ground, and then tried giving it 3 to 5 volts on the "S" pin, no sound, then again 3 to 5 volts on the middle pin with the same pin as ground as before. Again no sound.
How do I use this speaker?