Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobolinkAkademi/48ff995d14b2814a003ec6e6f1921fa2 to your computer and use it in GitHub Desktop.
Save RobolinkAkademi/48ff995d14b2814a003ec6e6f1921fa2 to your computer and use it in GitHub Desktop.
Arduino projeleri
#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