//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
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
int outputValue = 0; // value output to the PWM (analog out)
int sensorValue = 0; // value read from the pot
void setup()
{
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(3,0);
lcd.print("Hanne Kerkhofs");
}
void loop()
{
// print the results to the Serial Monitor:
lcd.setCursor(0,2);
lcd.print("output = ");
sensorValue = analogRead(analogInPin);
outputValue = map(sensorValue, 0, 1023, 0, 20);
lcd.print(outputValue);
lcd.print(" ");
}