Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

int data = 0;

int statusPress=0;

int doorOpen =0;

int doorClose =0;

bool alarm_modeDoor = false ;

bool alarm_modePIR = false ;

int switch_status;

int last_switch_status = LOW;

unsigned long lastDebounceTime = 0;

unsigned long debounceDelay = 50;

int lastButtonState = HIGH;

bool buttonState = HIGH;

byte tapCounter;

int timediff;

bool flag1, flag2;

long double presstime, releasetime;

int toggleSwitch;

int modeButton = 0;

int pilih;

DHT dht (DHTPIN, DHTTYPE);

BlynkTimer timer;
// Untuk Indikator Pintu

WidgetLED light(V2);

void DHT11Sensor()

float h = dht.readHumidity();

float t = dht.readTemperature();

//Read temperature as Fahrenheit

//float f = dht.readTemperature(true):

Blynk.virtualWrite(V5, t);

Blynk.virtualWrite(V6, h);

void MQ2gasSensor()

data = analogRead(MQ2);

Blynk.virtualWrite(V1, data);

if (data > 250 )

//Serial.println(LPG Detected!");

Blynk.setProperty(V1, "color", BLYNK_RED);

tone(buzzer, 500, 300);

else if (data > 100)


{

Blynk.setProperty(V1, "color", BLYNK_YELLOW);

else

Blynk.setProperty(V1, "color", BLYNK_GREEN);

You might also like