Pages: [1]   Go Down
Author Topic: query regarding lcd output  (Read 2828 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

#include <LiquidCrystal.h>


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int sensor=6;
int i=0;

void setup()
{
 
  lcd.begin(16, 2);
  pinMode(6,INPUT);
}

void loop()
{
  i=digitalRead(sensor);
  if(i==HIGH)
  {
    lcd.clear();
    lcd.write("HIGH");
  }
 
  else
  {
    lcd.clear();
    lcd.write("LOW");
  }
  delay(1000);

}
I have used a digital ir sensor. if the output of sensor is high then the lcd should display high otherwise it should display low. but i am getting  LOW followed by HIGH after every second irrespective of the state of ir sensor. please solve this problem of mine
Logged

Pages: [1]   Go Up
Jump to: