//**********BLYNK, identitas device*****************************
#define BLYNK_TEMPLATE_ID "TMPL6Qgg6E-F0"
#define BLYNK_TEMPLATE_NAME "00"
#define BLYNK_AUTH_TOKEN "3ruuYqFaGvKgUUPS2EdEpSf5OWOjGags"

//**********BLYNK, library**************************************
#include <BlynkSimpleEsp32.h>
#define buzzer 15

//**********BLYNK, ssid, pass, token****************************
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Wokwi-GUEST";
char pass[] = "";


//**********BLYNK, mendapat input dr blynk lewat datastream V0**
BLYNK_WRITE(V0)
{
   tone(buzzer,262, 2000);
  //delay(2000);
  tone(buzzer,400, 2000);
  //delay(2000);

}

//*********BLYNK, syncron data terakhir saat koneksi tersambung*
BLYNK_CONNECTED() { 
  Blynk.syncAll();
}


void setup() {
  //********LED, setting pin jadi output************************
  pinMode(buzzer, OUTPUT);
  

  //********BLYNK, mulai koneksi ke blynk***********************
  Blynk.begin(auth, ssid, pass);
  
}

void loop() {
  //********BLYNK, menjalankan blynk****************************
  Blynk.run();
}