Example
#include <conio.h> #include <stdio.h> #include "mmsultra.h"
void main(void) |
|
{ | // Print data structure |
PRINTINIT pConfig; | |
unsigned short usStatus = 0; | // Battery level |
short sStatus = 0; | // Command calls status |
sStatus = pclInit(NULL); | // Start Print subsystem |
if (sStatus != 0) |
|
printf("Init Failed\nError: %d", usStatus); | |
else |
|
{ | // Check battery |
usStatus = pclGetBatteryLevel(); | |
if (usStatus <= 711) |
|
printf(“Charge your battery”); |
|
else |
|
{ | // Get sensor state |
usStatus = pclGetBlackMarkSensor(); | |
switch (usStatus) | // Display result |
{ |
|
case 1: printf("Supplies are aligned"); break;
case 0: printf(“Supplies misaligned or system error”); break;
default:
pclClearError();
} |
|
} |
|
} | // Close Print subsystem |
pclClose(); |
}