#include <Wire.h>
#include <LiquidCrystal_I2C.h>

int _name ;
// For these LCD controls to work you MUST replace the standard LCD library from...
// https://github.com/marcoschwartz/LiquidCrystal_I2C
// Direct download https://github.com/marcoschwartz/LiquidCrystal_I2C/archive/master.zip
// Your project will not compile until this is done.
LiquidCrystal_I2C lcd_I2C_27(0x27,16,2); // set the LCD address for a 16 chars and 2 line display

void setup(){  // put your setup code here, to run once:
  Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
  pinMode( 7 , OUTPUT);   // sets the digital pin as output
  pinMode( 6 , OUTPUT);   // sets the digital pin as output
  pinMode( 5 , OUTPUT);   // sets the digital pin as output
  pinMode( 4 , OUTPUT);   // sets the digital pin as output
  pinMode( 8 , OUTPUT);   // sets the digital pin as output
  lcd_I2C_27.init (); // initialize the lcd
  lcd_I2C_27.backlight();
  pinMode( 9 , OUTPUT);   // sets the digital pin as output
  _name = 0 ;

}

void loop(){  // put your main code here, to run repeatedly:
  Serial.print(analogRead( A4 )); //print message
  Serial.print(" "); //print a blank
  Serial.println();
  delay( 20 ); // waits a few milliseconds 
  digitalWrite( 7 , HIGH );  // sets the digital pin on/off
  digitalWrite( 6 , HIGH );  // sets the digital pin on/off
  digitalWrite( 5 , HIGH );  // sets the digital pin on/off
  digitalWrite( 4 , HIGH );  // sets the digital pin on/off
  digitalWrite( 8 , HIGH );  // sets the digital pin on/off
  lcd_I2C_27.setCursor(4 , 0) ; // set the cursor, counting begins with 0 
  lcd_I2C_27.print( "hello playpr" ); // Print a message to the LCD.
  lcd_I2C_27.setCursor(2 , 1) ; // set the cursor, counting begins with 0 
  lcd_I2C_27.print( "point" ); // Print a message to the LCD.
  lcd_I2C_27.print( _name ); // Print a message to the LCD.
  digitalWrite( 9 , LOW );  // sets the digital pin on/off
  analogWrite(10 , 80);  //analogWrite values from 0 to 255 
  if ( analogRead( A0 ) < 700 ) {
    _name = ( _name + 10 ) ;
    delay( 1000 ); // waits a few milliseconds 
    lcd_I2C_27.clear();
    lcd_I2C_27.setCursor(11 , 1) ; // set the cursor, counting begins with 0 
    lcd_I2C_27.print( "point" ); // Print a message to the LCD.
    lcd_I2C_27.print( _name ); // Print a message to the LCD.
  }
  else  {
  }
  if ( analogRead( A2 ) < 700 ) {
    _name = ( _name + 3 ) ;
    delay( 1000 ); // waits a few milliseconds 
    lcd_I2C_27.clear();
    lcd_I2C_27.setCursor(11 , 1) ; // set the cursor, counting begins with 0 
    lcd_I2C_27.print( "point" ); // Print a message to the LCD.
    lcd_I2C_27.print( _name ); // Print a message to the LCD.
  }
  else  {
  }
  if ( analogRead( A3 ) < 700 ) {
    _name = ( _name + 4 ) ;
    delay( 1000 ); // waits a few milliseconds 
    lcd_I2C_27.clear();
    lcd_I2C_27.setCursor(11 , 1) ; // set the cursor, counting begins with 0 
    lcd_I2C_27.print( "point" ); // Print a message to the LCD.
    lcd_I2C_27.print( _name ); // Print a message to the LCD.
  }
  else  {
  }
  if ( analogRead( A4 ) < 700 ) {
    _name = ( _name + 5 ) ;
    delay( 1000 ); // waits a few milliseconds 
    lcd_I2C_27.clear();
    lcd_I2C_27.setCursor(11 , 1) ; // set the cursor, counting begins with 0 
    lcd_I2C_27.print( "point" ); // Print a message to the LCD.
    lcd_I2C_27.print( _name ); // Print a message to the LCD.
  }
  else  {
  }
}
