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

  1. #include "../h/rccl.h"
  2. #include "../h/hand.h"
  3. #include "../h/rtc.h"
  4. #include "../h/umac.h"
  5.  
  6. extern struct how how;
  7.  
  8. static int sensor;
  9.  
  10. #define TOUCHED 10
  11.  
  12. pumatask()
  13. {
  14.     int touchfn();
  15.     TRSF_PTR z, b1, b2, fing, getit, flip;
  16.     POS_PTR  get, p1, p2;
  17.     int q;
  18.  
  19.     z = gentr_trsl("Z",  0.,  0., 864.);
  20.     b1 = gentr_trsl("B1", 600. ,-200., 400.);
  21.     b2 = gentr_trsl("B2", 600. ,-100., 400.);
  22.     fing = gentr_rot("FING", 0., 0., 200., zunit, -90.);
  23.     getit = gentr_rot("GETIT", 600. , 0., 600., yunit, 180.);
  24.     flip = gentr_rot("FLIP", 0., 0., 0., yunit, 180.);
  25.  
  26.     p1 = makeposition("P1" , z, t6, fing, EQ, b1, flip,TL , fing);
  27.     p2 = makeposition("P2" , z, t6, fing, EQ, b2, flip,TL , fing);
  28.     get = makeposition("GET", z, t6, EQ, getit, TL, t6);
  29.  
  30.     sensor = adcopen(7);
  31.     setvel(300, 100);
  32.     move(get);
  33.     setime(100, 10000);
  34.     evalfn(touchfn);
  35.     move(get) ;
  36.     waitfor(completed);
  37.     if (get->code != TOUCHED) {
  38.         printf("timeout\n");
  39.     }
  40.     move(park);
  41. }
  42.  
  43.  
  44. touchfn()
  45. {
  46.     if (how.adcr[sensor] > 5) {
  47.         nextmove = TOUCHED;
  48.     }
  49. }
  50.