please i need you guys to help me to add buzzer on coding. i was use nodemcu esp8266 as my microcontroller and flame sensor as my input and the buzzer as a output. went the flame get 1 or high and the buzzer also high, responding to the flame sensor
this is coding. can some of u guys can help me to a add the buzzer
#define BLYNK_PRINT Serial #include <ESP8266WiFi.h> #include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
char auth = “”; //Auth code sent via Email
char ssid = “”; //Wifi name
char pass = “”; //Wifi Password
int flag=0;
void notifyOnFire()
{
int isButtonPressed = digitalRead(D1);
if (isButtonPressed==1 && flag==0) {
Serial.println(“Fire in the House”);
Blynk.notify(“Alert : Fire in the House”);
flag=1;
afiqsharul:
yes i using piezo buzzer, but i dont no how to add the buzzer to my coding because iam using nodemcu esp8266, because i am beginner
Are you using the Arduino ID to program the device? If so, my link above gives clear understanding on how to do this. Even if not using the Arduino IDE, you should be able to port this code.