Easy C Autonomus Code Not Counting

I have Been troubleshooting this code for about a week now and I still can not get it to count in the if loops, all of the variables are correct, but it will not count in the loops. help?


#include "Main.h" 

void Autonomous ( unsigned long ulTime ) 
{
      StartQuadEncoder ( 4 , 5 , 0 ) ; // Left Drive
      StartQuadEncoder ( 6 , 7 , 1 ) ; // Right Drive
      StartGyro ( 3 ) ;
      Potentiometer = GetAnalogInput ( 1 ) ; // Autonomous Select
      Auto_Jumper = GetDigitalInput ( 10 ) ;
      Left_Drive_Encoder = GetQuadEncoder ( 1 , 2 ) ; // Left Drive Encoder
      Right_Drive_Encoder = GetQuadEncoder ( 3 , 4 ) ; // Right Drive Encoder
      Gyro = GetGyroAngle ( 3 ) ; // Gyro
      InitLCD ( 1 ) ;
      SetLCDLight ( 1 , 1 ) ;
      while ( 1 )
      {            if ( Auto_Jumper == 0 ) // Jumper In = Auto Enable
            {                  if ( Potentiometer >= 0 && Potentiometer <= 256 )
                  {                        Wait ( 250 ) ;
                        Reset_Encoders ( ) ;
                        while ( Left_Drive_Encoder <= 1000 )
                        {
                              if ( Left_Drive_Encoder > Right_Drive_Encoder  )
                              {
                                    Drive_Forward_Slow_Left ( ) ;
                              }
                              else if ( Right_Drive_Encoder > Left_Drive_Encoder  )
                              {
                                    Drive_Forward_Slow_Right (   ) ;
                              }
                              else if ( Left_Drive_Encoder == Right_Drive_Encoder  )
                              {
                                    Drive_Forward ( ) ;
                              }
                        }
                        while ( Gyro < -900 )
                        {
                              Turn_Left ( ) ;
                        }
                        Reset_Encoders ( ) ;
                        while ( Left_Drive_Encoder <= 1000 )
                        {
                              if ( Left_Drive_Encoder > Right_Drive_Encoder  )
                              {
                                    Drive_Forward_Slow_Left ( ) ;
                              }
                              else if ( Right_Drive_Encoder > Left_Drive_Encoder  )
                              {
                                    Drive_Forward_Slow_Right ( ) ;
                              }
                              else if ( Left_Drive_Encoder == Right_Drive_Encoder  )
                              {
                                    Drive_Forward ( ) ;
                              }
                        }
                        Drive_Stop ( ) ;
                  }
                  else if ( Potentiometer >= 257 && Potentiometer <= 512 )
                  {
                        Wait ( 250 ) ;
                        Reset_Encoders ( ) ;
                        while ( Left_Drive_Encoder <= 1000 )
                        {
                              if ( Left_Drive_Encoder > Right_Drive_Encoder  )
                              {
                                    Drive_Forward_Slow_Left ( ) ;
                              }
                              else if ( Right_Drive_Encoder > Left_Drive_Encoder  )
                              {
                                    Drive_Forward_Slow_Right ( ) ;
                              }
                              else if ( Left_Drive_Encoder == Right_Drive_Encoder  )
                              {
                                    Drive_Forward ( ) ;
                              }
                        }
                        while ( Gyro < 900 )
                        {
                              Turn_Right ( ) ;
                        }
                        Reset_Encoders ( ) ;
                        while ( Left_Drive_Encoder <= 1000 )
                        {
                              if ( Left_Drive_Encoder > Right_Drive_Encoder  )
                              {
                                    Drive_Forward_Slow_Left ( ) ;
                              }
                              else if ( Right_Drive_Encoder > Left_Drive_Encoder  )
                              {
                                    Drive_Forward_Slow_Right ( ) ;
                              }
                              else if ( Left_Drive_Encoder == Right_Drive_Encoder  )
                              {
                                    Drive_Forward ( ) ;
                              }
                        }
                        Drive_Stop ( ) ;
                  }
                  else if ( Potentiometer >= 513 && Potentiometer <= 768 )
                  {
                  }
                  else if ( Potentiometer >= 767 && Potentiometer <= 1024 )
                  {
                  }
            }
            if ( Auto_Jumper == 1 ) // Jumper Out = Auto Disabled
            {
            }
      }
 }

We cant see your routines like Drive_Forward.
When you say “can not get it to count in the if loops”, if you mean you cant get the quad encoders to count up, it looks like you are not checking them inside the while(1) loop.
Also, high precision things like encoders or floating point numbers are hardly ever ==.
If you make your drive(r.l.s) use a heading, you can autogenerate a heading based on the delta in encoders.

Did you try turning it off then turning it on again?