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

  1. /*
  2.  * MAC  Version 2.0           Author :  Vincent Hayward
  3.  *                                      School of Electrical Engineering
  4.  *                                      Purdue University
  5.  *      Dir     : mac
  6.  *      File    : adc.c
  7.  *      Remarks : only a test program for the analog to digital converter
  8.  *      Usage   : cross compile and link with vec.o trap.o
  9.  */
  10.  
  11. #include "../h/adc.h"
  12. #include "../h/which.h"
  13. #include "../h/addefs.h"
  14. #include "../h/jcom.h"
  15. #include "../h/stdio11.h"
  16. main()
  17. {
  18.     short  n, j, d[16];
  19.  
  20.     setbuf(stdin, NULL);
  21.     setbuf(stdout, NULL);
  22.  
  23.     while (!getio(ARMPWR))
  24.         ;
  25.     bicio(ARMPWR);
  26.     bisio(ARMPWR);
  27.     put6pg(MODE, MESERVO|MEPOSSV);
  28.     for (; ; ) {
  29.         for (j = 0; j < 16; ++j) {
  30.             ADCV(d[j], j);
  31.         }
  32.         for (j = 0; j < 16; ++j) {
  33.             printf("%o\n",d[j]);
  34.         }
  35.         printf(
  36. "\n------------------------------------------------------------------------\n"
  37.               );
  38.         n = 30000;
  39.         while (n--)
  40.             ;
  41.     }
  42. }
  43.  
  44.  
  45. zexit(n){
  46.     printf("\nexit %d", n);
  47. }
  48.