Last active
October 28, 2019 07:22
-
-
Save RobolinkAkademi/e7a0425a6f09a2873568758e7330d70c to your computer and use it in GitHub Desktop.
tum yil icin arduino mufredati 23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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