I need to conect a 3 pin buzzer to nodeMCU but it makes sounds all the time and not with the blynk button as it is supposed to, what should I change?
Thanks
My code:
#define BLYNK_PRINT Serial
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] ="fc8011eb784b419684be7ca1f5918852";
//WiFi credentials.
char ssid[] = "******";
char pass[] = "******";
WidgetMap myMap(V0);
void setup()
{
//Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
//BUZZER
pinMode(D3,OUTPUT);
//
//MAP
int index = 1;
float lat = 51.5074;
float lon = 0.1278;
myMap.location(index, lat, lon, "value");
//
}
void loop()
{
Blynk.run();
//BUZZER
digitalWrite(D3,HIGH);// Buzz sound
delay(1);//delay 1ms
digitalWrite(D3,LOW);// silent
delay(1);//delay 1ms
//
}