home *** CD-ROM | disk | FTP | other *** search
/ Between Heaven & Hell 2 / BetweenHeavenHell.cdr / 500 / 471 / rccl221 < prev    next >
Text File  |  1987-03-02  |  923b  |  50 lines

  1. #include "../h/rccl.h"
  2. #include "../h/rtc.h"
  3. #include "../h/hand.h"
  4. #include "../h/umac.h"
  5.  
  6. extern struct how how;
  7. extern struct chg chg;
  8. int sensor;
  9.  
  10. pumatask()
  11. {
  12.     TRSF_PTR z, b1, fing;
  13.     POS_PTR  p1;
  14.     int fingfn();
  15.     int q;
  16.  
  17.     fing = newtrans("FING",fingfn);
  18.     z = gentr_rot("Z",  0.,  0., 864., zunit, 0.); /* at the base */
  19.     b1 = gentr_rot("B1", 600. , 300., 500., yunit, 180.);
  20.  
  21.     b1->fn = hold;
  22.     p1 = makeposition("P1" , z, t6, fing, EQ, b1, TL, fing);
  23.  
  24.     OPEN;
  25.     printf("hand the sensor to the beast\n");
  26.     printf("press return when ready : ");
  27.     getchar();
  28.  
  29.     CLOSE;
  30.     printf("press return to start : ");
  31.     getchar();
  32.     sensor = adcopen(7);
  33.  
  34.     movecart(p1, 400, 1500);
  35.     for (; ; ) {
  36.         movecart(p1, 200, 20000);
  37.         waitfor(completed);
  38.         QUERY(q); if (q == 'n') break;
  39.     }
  40.     movejnts(park, 400, 1500);
  41. }
  42.  
  43. #define CV      .01
  44.  
  45. fingfn(t)
  46. TRSF_PTR t;
  47. {
  48.     t->p.z = CV * how.adcr[sensor];
  49. }
  50.