//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <LiquidCrystal_I2C.h>
#include <MD_REncoder.h>
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
MD_REncoder R = MD_REncoder(2, 3);
int count = 0;
int level = 0;
void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
//lcd.print((count*25)+8700);
lcd.print(count);
R.begin();
}
void loop()
{
uint8_t x = R.read();
if (x)
{
x == DIR_CW ? count++ : count--;
if (count > 95)
count = 95;
if (count < 0)
count = 0;
//lcd.print((count*25)+8700);
display();
}
}
void display(){
lcd.clear();
byte y = (count-1)/5;
lcd.setCursor(y, 0);
lcd.print(count);
}