Example #1
0
void main_nodisplay() {
  float x, y, z = 0;
  
  // main loop  
   while(1) 
  {  
    led1=led2=led3=led4=0;
    mnu->SetScreen("Wait for file ...");
    while (srv->State() == listen)
        Net::poll();
    GetFile();
    mot->reset();
    plan_get_current_position_xyz(&x, &y, &z);
     printf("%f %f\n", x,y); 
    mnu->SetScreen("Laser BUSY..."); 
    
    char name[32];
    srv->getFilename(name);
    printf("Now processing file: '%s'\n\r", name);
    FILE *in = sd.openfile(name, "r");
    while (!feof(in))
    { 
      while (!mot->ready() );
      mot->write(readint(in));
    }
    fclose(in);
    removefile(name);
    // done
    printf("DONE!...\n");
	while (!mot->ready() );
    mot->moveTo(cfg->xrest, cfg->yrest, cfg->zrest);
  }
}
Example #2
0
/**
*** get the absolute position
**/
void LaosMotion::getPosition(int *x, int *y, int *z)
{
  float xx,yy,zz;
  plan_get_current_position_xyz(&xx, &yy, &zz);
  *x = xx * 1000;
  *y = yy * 1000;
  *z = zz * 1000;
}