Created
October 28, 2019 11:36
-
-
Save RobolinkAkademi/48ff995d14b2814a003ec6e6f1921fa2 to your computer and use it in GitHub Desktop.
Arduino projeleri
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 <LiquidCrystal.h> | |
LiquidCrystal lcd(12,11,5,4,3,2); | |
int pirsensor = 8; | |
int state = LOW; | |
int val = 0; | |
void setup() | |
{ | |
Serial.begin(9600); | |
lcd.begin(16,2); | |
pinMode(pirsensor, INPUT); | |
lcd.clear(); | |
lcd.setCursor(0,0); | |
lcd.print("Robolink"); | |
lcd.setCursor(7,1); | |
lcd.print("Teknoloji"); | |
delay(1000); | |
} | |
void loop() | |
{ | |
val = digitalRead(pirsensor); | |
if (val == HIGH) | |
{ | |
delay(100); | |
if (state == LOW) | |
{ | |
Serial.println("Hareket Algilandi"); | |
lcd.clear(); | |
lcd.setCursor(0,0); | |
lcd.print("Hareket"); | |
lcd.setCursor(0,1); | |
lcd.print("Algilandi"); | |
state = HIGH; | |
} | |
} | |
else | |
{ | |
if (state == HIGH) | |
{ | |
Serial.println("Hareket Yok"); | |
lcd.clear(); | |
lcd.setCursor(0,0); | |
lcd.print("Hareket"); | |
lcd.setCursor(0,1); | |
lcd.print("Yok"); | |
state = LOW; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment