Friday, February 22, 2019

11

งานที่ 11
             
                 Code
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
int aval,temp_aval=0;
void setup()
{
  lcd.begin();
  lcd.setCursor(0,0);
  lcd.print("aval = ");
}
void loop()
{
   aval = analogRead(A0);
   if (temp_aval != aval)
   {
      lcd.setCursor(7,0);
      lcd.print("    ");
   }
   lcd.setCursor(7,0);
   lcd.print(aval);
   temp_aval = aval;
   delay(300);
}

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; ...