Sources/main.c
void calibrate_motor(void) {
  int i;
  TIE = 0x00;
  INTCR = 0x40;
  PWMDTY2 = 0x02;
  PWMDTY3 = 0xEE;

  reset = 1;
  PTT_PTT6 = 1;
  while (reset) one_step(5);

  PTT_PTT6 = 0;
  for (i = 0; i < 1000; i++) one_step(5);

  INTCR = 0x40;
  reset = 1;
  PTT_PTT6 = 1;
  while (reset) one_step(50);

  despos = sw[0];
  INTCR = 0x00;
  TIE = 0x80;
}
/* Calibrate motor to rest near calibration button */
Calibrate motor to rest near calibration button
Calibrate motor to rest near calibration button
void calibrate_motor(void) {
  int i;
  TIE = 0x00;
  INTCR = 0x40;
  PWMDTY2 = 0x02;
  PWMDTY3 = 0xEE;
  reset = 1;
  PTT_PTT6 = 1;
  while (reset) one_step(5);
  PTT_PTT6 = 0;
  for (i = 0; i < 1000; i++) one_step(5);
  INTCR = 0x40;
  reset = 1;
  PTT_PTT6 = 1;
  while (reset) one_step(50);
  despos = sw[0];
  INTCR = 0x00;
  TIE = 0x80;
}
void calibrate_motor ( void ) { int i ; TIE = 0x00 ; INTCR = 0x40 ; PWMDTY2 = 0x02 ; PWMDTY3 = 0xEE ; reset = 1 ; PTT_PTT6 = 1 ; while ( reset ) one_step ( 5 ) ; PTT_PTT6 = 0 ; for ( i = 0 ; i < 1000 ; i ++ ) one_step ( 5 ) ; INTCR = 0x40 ; reset = 1 ; PTT_PTT6 = 1 ; while ( reset ) one_step ( 50 ) ; despos = sw [ 0 ] ; INTCR = 0x00 ; TIE = 0x80 ; }
Calibrate motor to rest near calibration button
Calibrate motor to rest near calibration button