Silicon Laboratories Stepper Machine Manual de usuario Pagina 26

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 36
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 25
AN155
26 Rev. 1.1
theChar = getc(); // get character to be parsed
switch(theChar) // parse character
{
case '\r': // if return character
putc('\n'); // linefeed with no carriage return
putc('>'); // display prompt
break;
case 'p': // p for new position
newP = getuint(); // get number as unsigned integer
newline();
puts("Moving..."); // display moving status indicator
newline();
puts("Position:"); // display position tag
newline();
move(newP); // initiate move to new position
break;
case 'a': // a for change acceleration
Tzero = getuchar(); // get number as unsigned character
newline();
puts("Acceleration:"); // confirm acceleration changed
newline();
putuint(Tzero); // display new acceleration
newline();
putc('>');
break;
case 's': // s for display status
newline();
puts("Position:"); // display position tag
newline();
putuint(Position); // display position value
newline();
puts("Acceleration:"); // display acceleration tag
newline();
putuint(Tzero); // display acceleration value
newline();
putc('>'); // display prompt
break;
default:
error(); // display error message
}
}
}
}
//-----------------------------------------------------------------------------
// SYSCLK_Init
//-----------------------------------------------------------------------------
//
// This routine initializes the system clock to use the internal 24.5MHz
// oscillator as its clock source. Also enables missing clock detector reset.
//
void SYSCLK_Init (void)
{
OSCICN = 0x07; // set SYSCLK to OSC frequency
RSTSRC = 0x04; // enable missing clock detector
PCA0MD &= ~0x40; // disable watchdog timer
}
//-----------------------------------------------------------------------------
Vista de pagina 25
1 2 ... 21 22 23 24 25 26 27 28 29 30 31 ... 35 36

Comentarios a estos manuales

Sin comentarios