Programming Light Flashes Red

I just assembled the basic robot according to the manual in the kit. When I turn it on it fails to do anything and the programming light flashes red. I have attempted to tether it to the TX with the proper cable which resulted in the same problem. The Motor PWM cables are placed in the motor 2+3 slots.

The programming light flashing red indicates a problem with the User Code. If you have a programming kit, download Default Code into the Vex Controller. Otherwise, return the unit to Radio Shack.

I’ve written a small program using easyC 2.0 and downloaded to the VEX. The program is polling serial port one, looking for commands. While it is running, the PGRM STATUS LED flashes red 3 times at 1 second intervals then it is off for 2-3 seconds. This pattern repeats continuously. Also, the motor (I’m only using one.) runs very briefly (1/8 of a rotation) at random intervals.

The programming light flashing red indicates a problem with the User Code. Download Default Code into the Vex Controller. If the Controller is now working with no Red LEDS flashing, just add small pieces of your code to the default code until the problem returns. Now just find the problem with the last section of code you added.

This code is making the program light flash red:

void wait(unsigned int m_sec) 
{ 
   unsigned int temp; 
   unsigned int iter; 

   if (m_sec>2000) 
   { 
      iter = 2000; 
   } 
   else 
   { 
      iter = m_sec; 
   } 

   while(iter) 
   { 
      temp = 500; 

      while(temp) 
      { 
         temp--; 
      } 
       
      iter--; 
   } 
} 

The funny this is that it only lights up when I use the function a few times in a row, or if its argument exceeds 2200 or so . . . Any ideas why this would happen? This code compiles with no errors.

You need to have the getdata and putdata inside your while loop. If these functions are not called ever loop the Master think the User processor is lost and then holds the User in reset.