#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
#define Switch 10
#define Switch2 8
float Counter=0; // 0.1 se badhega ya ghatega....me yaha 0.5 kar raha hun
void setup() {
pinMode(Switch,INPUT_PULLUP);
pinMode(Switch2,INPUT_PULLUP);
Serial.begin(9600);
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Starting...");
delay(2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Set Point =");
lcd.setCursor(12, 0);
lcd.print(Counter);
}
void loop() {
if(digitalRead(Switch)==0){
Counter+=0.5; // 0.1 se badhega ya ghatega....me yaha 0.5 kar raha hun
lcd.setCursor(0, 0);
lcd.print("Set Point =");
lcd.setCursor(12, 0);
lcd.print(Counter);
while(digitalRead(Switch)==0);
delay(20);//Debounce
}
if(digitalRead(Switch2)==0){
Counter-=0.5; // 0.1 se badhega ya ghatega....me yaha 0.5 kar raha hun
lcd.setCursor(0, 0);
lcd.print("Set Point =");
lcd.setCursor(12, 0);
lcd.print(Counter);
while(digitalRead(Switch2)==0);
delay(20);//Debounce
}
}