int mq135; int gas; void setup() { Serial.begin(9600); pinMode(A0, INPUT); } void loop() { // put your main code here, to run repeatedly: mq135 = analogRead(A0); gas = mq135 / 8; if (gas > 100){gas = 100; } else if (gas < 55){gas = 0; } Serial.println(gas); //kirim data BHC-06 Serial.print("*G"+String(gas)+"*"); if (gas >= 55){ Serial.print("*T"+String("Terdeteksi Kebocoran Gas")+"*"); Serial.print("*LR255G0B0*"); Serial.print("*BV255*"); delay(500); Serial.print("*LR255G255B255*"); Serial.print("*BV0*"); delay(500); } else{ Serial.print("*T"+String("Kondisi Aman")+"*"); Serial.print("*LR0G255B0*"); Serial.print("*BV0*"); } }