Page 1 of 1

The Code doesn't work for passive buzzer, piezo buzzer.

Posted: Thu Dec 08, 2022 9:23 am
by Ahmet58
Hello, I want to receive sound at various frequencies from the passive buzzer whose + end is connected to pin 4 (D12) of firebeetle esp32-e. However, I was never able to do that. When I measure the frequency on the pin, I usually see fluctuations between 50hz and 80hz. Where could I be doing wrong? Can you help me?
I have added the simple code.
I also tested other pins. the result is negative.

#include <pitches.h>
#include <Tone32.h>

int Buzzer1 = 4; //d12

void setup()
{
Serial.begin(115200);
pinMode( Buzzer1, OUTPUT);
}
void loop()
{
tone(Buzzer1, 200);
}