//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
int waarde;
void setup()
{
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(3,0);
lcd.print("Jonas");
}
void loop()
{
waarde = map(analogRead(A0),0,1023,0,20);
lcd.setCursor(0,1);
lcd.print(waarde);
lcd.print(" ");
for(int a = waarde;a <= 20; a++)
{
lcd.setCursor(a,2);
lcd.print(" ");
}
for(int b = waarde-1;b >= 0; b--)
{
lcd.setCursor(b,2);
lcd.print("*");
}
}