Can't upload programm

I started programming my project,using arduino uno,motor drive,lcd,and 4 analog sensors

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

int motorLEFTpin1 = 8;              //define digital output pin no.
int motorLEFTpin2 = 9;              //define digital output pin no.
int motorRIGHTpin1 = 10;
int motorRIGHTpin2 = 11;

void setup () {

  pinMode(motorLEFTpin1,OUTPUT);        //set pin 8 as output

  pinMode(motorLEFTpin2,OUTPUT);        // set pin 9 as output
  
  pinMode(motorRIGHTpin1,OUTPUT);       // set pin 10 as output
 
  pinMode(motorRIGHTpin2,OUTPUT);        // set pin 11 as output

}

int analogPin0 = 0;        //pin0 =  Start
int analogPin1 = 1;        // pin1 = middle IR
int analogPin2 = 2;        //pin2 = right IR
int analogPin3 = 3;        // pin3 = left IR

int val0 = 0;           // variable to store the value read
int val1 = 0;
int val2 = 0;
int val3 = 0;

void loop()
{
  val0 = analogRead(analogPin0);  
  val1 = analogRead(analogPin1); 
  val2 = analogRead(analogPin2);
  val3 = analogRead(analogPin3);    // read the input pin



  if (val0 > 920) {
    digitalWrite(motorLEFTpin1,LOW);

    digitalWrite(motorLEFTpin2,HIGH);
  
    digitalWrite(motorRIGHTpin1,HIGH);

    digitalWrite(motorRIGHTpin2,LOW);

}}

Everything is OK with ‘Verify’ but when i click ‘Upload’ i get this message:
Binary sketch size: 2126 bytes (of a 32256 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00

What’s wrong?

wizer: Everything is OK with 'Verify' but when i click 'Upload' i get this message: Binary sketch size: 2126 bytes (of a 32256 byte maximum) avrdude: stk500_getsync(): not in sync: resp=0x00

What's wrong?

Easy question, easy answer: Arduino not connected ;) - Does Serial Monitor work ? - Does Reset help (Keep reset button pressed until "Binary sketch size ..." shows up, then release button immediately) ?

you are right.it was so simple...thank you Now i got a new problem..despite the fact that i give to my analog sensor a value >920, the motors don't work. Motors are ok because i check that with this code which is exactly what i paste (for motors function) at the main program

int motorLEFTpin1 = 8;                  //define digital output pin no.

int motorLEFTpin2 = 9;              //define digital output pin no.

int motorRIGHTpin1 = 10;

int motorRIGHTpin2 = 11;


void setup () {

  pinMode(motorLEFTpin1,OUTPUT);        //set pin 8 as output

  pinMode(motorLEFTpin2,OUTPUT);        // set pin 9 as output
  
  pinMode(motorRIGHTpin1,OUTPUT);       // set pin 10 as output

  pinMode(motorRIGHTpin2,OUTPUT);        // set pin 11 as output

}

void loop () {

  digitalWrite(motorLEFTpin1,LOW);

  digitalWrite(motorLEFTpin2,HIGH);
  
  digitalWrite(motorRIGHTpin1,HIGH);

  digitalWrite(motorRIGHTpin2,LOW);

}

Now i got a new problem..despite the fact that i give to my analog sensor a value >920

How are you managing to "give my analog sensor a value > 920"?

Use Serial.begin() in setup(), and Serial.print() in loop(), and print the value that you read from the sensor. It may not be what you think it is.

My analogue sensor is a photoresistance.i see at serial port (in another 'testing sensor' program) that its value is about 820 when i don't have light on it and when i light on it,value goes around 940.so i think,that 920 is a nice value to set as a limit. i used serial.begin and serial.println in the programm i did to test the sensor.here it is.it tests all my 4 analog inputs (sensors)

int analogPin0 = 0;        //pin0 =  Start
int analogPin1 = 1;        // pin1 = middle IR
int analogPin2 = 2;        //pin2 = right IR
int analogPin3 = 3;        // pin3 = left IR
int val0 = 0;           // variable to store the value read
int val1 = 0;
int val2 = 0;
int val3 = 0;


void setup()
{
  Serial.begin(9600);          //  setup serial
}

void loop()
{
  val0 = analogRead(analogPin0);  
  val1 = analogRead(analogPin1); 
  val2 = analogRead(analogPin2);
  val3 = analogRead(analogPin3);    // read the input pin
  Serial.println(val0);  
  Serial.println("\t"); 
  Serial.println(val1);
  Serial.println("\t");
  Serial.println(val2);
  Serial.println("\t");
  Serial.println(val3);
  Serial.println("\t");
  Serial.println("\t");
  Serial.println("\t");
  Serial.println("\t");
  delay (1000);                  // delay 1000 msec
}

This code doesn't do anything with the motors. You need to put the Serial.begin() and Serial.print() stuff in the program that is supposed to run the motors.

OK,i put the serial.begin and serial.print stuff in my main programm.serial monitor shows the sensor values again but the motors still don’t work.the programm now is

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

int motorLEFTpin1 = 8;              //define digital output pin no.
int motorLEFTpin2 = 9;              //define digital output pin no.
int motorRIGHTpin1 = 10;
int motorRIGHTpin2 = 11;

void setup () {
  Serial.begin(9600); 
  
  pinMode(motorLEFTpin1,OUTPUT);        //set pin 8 as output
  pinMode(motorLEFTpin2,OUTPUT);        // set pin 9 as output
  pinMode(motorRIGHTpin1,OUTPUT);       // set pin 10 as output
  pinMode(motorRIGHTpin2,OUTPUT);        // set pin 11 as output
}

int analogPin0 = 0;        //pin0 =  Start
int analogPin1 = 1;        // pin1 = middle IR
int analogPin2 = 2;        //pin2 = right IR
int analogPin3 = 3;        // pin3 = left IR

int val0 = 0;           // variable to store the value read
int val1 = 0;
int val2 = 0;
int val3 = 0;

void loop()
{
  val0 = analogRead(analogPin0);  
  val1 = analogRead(analogPin1); 
  val2 = analogRead(analogPin2);
  val3 = analogRead(analogPin3);       // read the input pin

  
  Serial.println(val0);  
  Serial.println("\t"); 
  Serial.println(val1);
  Serial.println("\t");
  Serial.println(val2);
  Serial.println("\t");
  Serial.println(val3);
  Serial.println("\t");
  Serial.println("\t");
  Serial.println("\t");
  Serial.println("\t");
  delay (1000);                  // delay 1000 msec
 
  if ( analogPin0 > 900) {
    
    digitalWrite(motorLEFTpin1,LOW);

    digitalWrite(motorLEFTpin2,HIGH);
  
    digitalWrite(motorRIGHTpin1,HIGH);

    digitalWrite(motorRIGHTpin2,LOW);

}}

thank you very much for being helpful

analogPin0 is always 0 and will not change.

  if ( analogPin0 > 900) {

Why?i see the value of analogpin0 (A0) changing at serial monitor

No, you print out val0 and not analogpin0. The first one is the measured value, the second one is the pin number where you attached the sensor.

val0 = analogRead(analogPin0);

this command doesn't bring the analogPin0 value to the variable val=0?

If no,how can i do this?

Yes, it does, but you are not testing val0 here...

  if ( analogPin0 > 900) {

You are testing the variable that holds the pin number, which, being defined as

int analogPin0 = 0;        //pin0 =  Start

will never be > 900.

You want

  if (val0 > 900) {

instead.

it's working!!!!!!!!!! thank you very much!all of you!