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

Ahmet58
Posts: 21
Joined: Sat Jan 22, 2022 8:38 pm

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

Postby Ahmet58 » Thu Dec 08, 2022 9:23 am

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);
}

Who is online

Users browsing this forum: No registered users and 16 guests