Example
#include <stdio.h> #include <conio.h> #include "mmsultra.h"
void main(void) |
|
{ | // Print data structure |
PRINTINIT pConfig; | |
unsigned short usStatus = 0; | // Battery level |
short sStatus = 0; | // Command call status |
sStatus = pclInit(NULL); | // Start Print subsystem |
if (sStatus != 0) |
|
printf("Init Failed\nError: %d", sStatus); | |
else |
|
{ | // Get the battery level |
usStatus = pclGetBatteryLevel(); | |
if (usStatus > 711) | // If level OK, |
{ | // Feed supplies |
usStatus = pclFeed(); | |
if (usStatus != 0) |
|
{ |
|
printf("Feed
pclClearError();
} |
|
} |
|
else | // Display low level msg |
printf("Charge battery"); | |
} | // Close Print subsystem |
pclClose(); |
}