home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0040 - 0049 / ibm0040-0049 / ibm0040.tar / ibm0040 / IMGPROC.ZIP / C4.ZIP / TEST1.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-06  |  2.8 KB  |  79 lines

  1. /*  
  2. Copyright 1990 by John Wiley & Sons, Inc.
  3.           All Rights Reserved.
  4. */
  5. /*********************************************************/
  6. /***                  Listing P2Ch3L2                  ***/
  7. /***          Video Digitizer Test Program One         ***/
  8. /***                written in Turbo C                 ***/
  9. /***                        by                         ***/
  10. /***                 Craig A. Lindley                  ***/
  11. /***                                                   ***/
  12. /***         Ver: 1.0    Last Update: 08/04/89         ***/
  13. /*********************************************************/
  14.  
  15. #include <stdio.h>
  16. #include <conio.h>
  17.  
  18. #include "digitizer.h"
  19.  
  20. #define MaxBitNum  9                   /* 10 bit counter 0 .. 9 */
  21.  
  22. /*
  23. This program is used to test the pixel count latches on the digitizer.
  24. It will set each of the 10 bits high sequentially, so they can be
  25. checked with a meter.
  26. */
  27.  
  28.  
  29. void main( void )
  30. {
  31.    struct   ImageReq Req;              /* ImageReq structure */
  32.    unsigned BitShift, BitPattern;
  33.  
  34. /*
  35.    Build a structure that defines what the digitizer should acquire.
  36.    This will be passed to the digitizer by a call to InitializeDigitizer
  37.    function. This also tells the low level code where the digitizer
  38.    is attached.
  39. */
  40.  
  41.    Req.ComputerType   = PS220;
  42.    Req.PrtBase        = 0x3BC;
  43.    Req.HMode          = LowRes;
  44.    Req.VMode          = NonInterlace;
  45.    Req.NumberOfPasses = 1;
  46.    Req.Flags          = 0L;
  47.    Req.FirstLine      = 0;
  48.    Req.FirstPixel     = 0;
  49.    Req.LastLine       = 200;
  50.    Req.LastPixel      = 320;
  51.  
  52.    InitializeDigitizer(&Req);          /* initialize the digitizer */
  53.  
  54.    clrscr();
  55.    printf("Digitizer Test Program One - Pixel Counter Latch Test\n\n");
  56.    printf("Each bit from LSB to MSB will be set to a high level\n");
  57.    printf("with all other bits set low.\n");
  58.    printf("The output of the pixel latches should be checked with\n");
  59.    printf("with a meter at the following locations on the digitizer\n\n");
  60.    printf("Bit Number -  9   8   7   6   5   4   3   2   1   0\n");
  61.    printf("Device Pin #  1  15   9  10   1  15   9  10   1  15\n");
  62.    printf("Device #     |IC12|   |--- IC11 --|   |--- IC10 --|\n\n");
  63.    printf("A low is < .8 VDC and a high is > 2.5 VDC\n\n");
  64.  
  65.    SetPixelCount( 0 );                 /* set all bits to zero */
  66.    printf("All bits of the pixel counter latch should now be low\n");
  67.  
  68.    for (BitShift=0; BitShift <= MaxBitNum; BitShift++)
  69.    {
  70.      printf("Press any key to continue\n\n");
  71.      getch();
  72.      BitPattern = 1 << BitShift;
  73.      SetPixelCount( BitPattern );
  74.      printf("Test bit pattern is: %x\n",BitPattern);
  75.    }
  76.    printf("Test Completed\n");
  77. }
  78.  
  79.