Example
#include <conio.h> #include <stdio.h> #include "mmsultra.h"
void main(void) |
|
{ | // Status of comm. calls |
short sStatus = 0; | |
char cBuffer[100]; | // Application buffer |
char *pBufptr = NULL; | // Pointer to cBuffer |
int iInput = 0; | // Trigger input |
sStatus = scnOpenScanner(); | // Enable scanner |
if (sStatus ==
printf("Scanner
if (iInput == 0)
{
iInput = _getch(); |
|
if (iInput == 0x85) |
|
{ |
|
pBufptr = scnGets(cBuffer); |
|
if (pBufptr == NULL) |
|
printf("\nScanner error"); |
|
else |
|
{ | // Beep for success |
spkBeep(1, 1000); | |
sStatus = scnGetch(); | // Get first char |
if (sStatus < 0) | // Display result |
printf(“Error getting | |
else |
|
printf("\nFirst Char is %c", sStatus); | |
} |
|
} |
|
} | // Disable scanner |
sStatus = scnCloseScanner(); |
}