arbotix_firmware/src/diff_controller.h
/* This is called by the main loop, does a X HZ PID loop. */
This is called by the main loop, does a X HZ PID loop.
This is called by the main loop does a X HZ PID loop .
void updatePID(){
  if((moving > 0) && (PIDmode > 0)){  
    unsigned long j = millis();
    if(j > f_time){
      left.Encoder = Encoders.left;
      right.Encoder = Encoders.right;
      DoPid(&left);
      DoPid(&right);
      if(PIDmode > 0){
        drive.set(left.output, right.output);
      }
      f_time = j + FRAME_RATE;
    }
  }
}
void updatePID ( ) { if ( ( moving > 0 ) && ( PIDmode > 0 ) ) { unsigned long j = millis ( ) ; if ( j > f_time ) { left . Encoder = Encoders . left ; right . Encoder = Encoders . right ; DoPid ( & left ) ; DoPid ( & right ) ; if ( PIDmode > 0 ) { drive . set ( left . output , right . output ) ; } f_time = j + FRAME_RATE ; } } }
This is called by the main loop, does a X HZ PID loop.
This is called by the main loop does a X HZ PID loop .
// otherwise, just return // update encoders // do PID update on PWM // set updated motor outputs       // update timing