Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
tum yil icin arduino mufredati 23
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F,16,2);
#define sensor_pin A0
#define sensor_pin 8
int buzzer=9;
#define preheat_time 5000
void setup() {
lcd.begin();
pinMode(2,OUTPUT);
pinMode(9,OUTPUT);
}
void loop() {
lcd.setCursor(0,0);
lcd.print("Hava Kontrol");
lcd.setCursor(0,1);
lcd.print("Ediliyor");
delay(5000);
int sensorValue = analogRead(sensor_pin);
digitalWrite(9,LOW);
digitalWrite(2,LOW);
if (sensorValue >= 400)
{ digitalWrite(2,HIGH);
digitalWrite(9,HIGH);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Zararlı gaz");
lcd.setCursor(0,1);
lcd.print("tespit edildi");
delay(3000);
lcd.clear();
}
else
{ digitalWrite(2,LOW);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Hava Temiz");
delay(4000);
lcd.clear();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment