Friday, February 22, 2019

13

                                                                        งานที่ 13


Code
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
int PIRpin = 8;
void setup() 
  lcd.begin();
  pinMode(PIRpin,INPUT);
  lcd.home();
  lcd.print("Waiting for PIR");
  delay(10000);       
  lcd.clear();
}
void loop()
  int x = digitalRead(PIRpin);
  lcd.home();
  lcd.print("PIR = ");
  lcd.print(x);
  delay(100);
}

No comments:

Post a Comment

MINI Project ตัวจับเวลา

#include <LiquidCrystal.h> LiquidCrystal lcd(7,6,5,4,3,2); const int set = 8; int hours=10; int start=11;  int relay=9; ...