View Single Post
  #8   Spotlight this post!  
Unread 14-01-2008, 23:27
Nightfall831 Nightfall831 is offline
Registered User
AKA: Paul
FRC #0888 (Robotiators)
Team Role: Alumni
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Maryland
Posts: 29
Nightfall831 will become famous soon enoughNightfall831 will become famous soon enough
Send a message via AIM to Nightfall831
Re: Getting constant motor power with IR board

hmmm....i don't quite understand this part

Code:
sensorReading  = PORTJ>>4;  // Combined digital inputs 15-18

  if (latch == 1) 
  {
    if (sensorReading == 0)
    {
      latch = 0; // Take only the 1st reading to avoid being caught by a half & half state of the IR sensor
    }
  }
  else if (sensorReading != 0)
  {
       latch = 1;

       if (sensorReading == 8)      IR_cmd = 1;
       else if (sensorReading == 4) IR_cmd = 4;
       else if (sensorReading == 2) IR_cmd = 2;
       else if (sensorReading == 1) IR_cmd = 3;

        printf("IR_cmd = %d\r\n", IR_cmd);
}
what exactly does this do? especially the first part.
__________________


That's a PEBKAC problem. (Problem Exists Between Keyboard And Chair)
^Yea, I never run into those...