M5StickC-Plus Buzzer not working
-
I have several M5StickC-Plus's but I cannot seem to get the buzzer to work. The factory test has code in it to use the buzzer on button press but it does not seem to work. Can someone point me to code to make this buzzer work?
Thanks. -
try to use UIFlow for the test
-
I have not used uiflow before but tried to get it running to test this. I was unable to get uiflow working on my windows 10 system.
Please provide an arduino C example. -
On my two M5StickC-Plus the Buzzer is also not working. Please provide an Arduino example.
-
The default volume is very low and probably only audible to young bats :)
-
Hello @wilfried
Arduino example:
https://101010.fun/iot/m5stickc-plus-firststep.html -
@macsbug Still very faint!
Not useable! -
I'm not sure what is connected to it, probably some tiny piezo speaker, but pin G2 is the "buzzer" pin.
There is a way to set up PWM on a pin at a desired frequency. Also, sometimes these speakers are resonant, so much louder at a particular frequency.
Example using the API, below:
-
Using //https://101010.fun/iot/m5stickc-plus-firststep.html
for inspiration, we can upload this program:#include <M5StickCPlus.h>
void setup() {
M5.begin();
M5.Lcd.setTextSize(3);
M5.Lcd.setRotation(3);
M5.Lcd.setTextColor(TFT_ORANGE);
}void loop() {
M5.update();
soundTest();
}void soundTest() {
for (int tone=100; tone < 4000; tone=tone+50) {
M5.Lcd.fillScreen(BLACK);
M5.Lcd.setCursor(80, 50);
M5.Lcd.printf("%d", tone);
M5.Beep.tone(tone);
M5.Beep.update();
delay(200);
}
}According to my ears there is a definite peak about 2500 Hz, with frequencies under 250 Hz and over 3000 not audible. Your ears may vary .....
-
@wilfried Ok, that workrd. ThankYou