![]() |
DM&P Text LCM DOS Library Reference |
| 2002/06/18 Version 1.01 |
If you have any problem, mail to soc@dmp.com.tw please.
#include <stdio.h>
#include "textlcm.h"
void main()
{
char cType;
int nLcmType;
printf("\nDM&P Text LCM Library Demo Program, %s %s.\n\n",__DATE__,__TIME__);
printf("TextLCM Library Version %s\n\n",TextLcm_Version());
printf("1. GPIO\n");
printf("2. Printer Port\n");
printf("\nYour LCM type: ");
scanf("%c",&cType);
switch(cType)
{
case '1': nLcmType = LCM_GPIO; break;
case '2': nLcmType = LCM_PRN; break;
default: printf("Error\n"); return;
}
/* Initialize text LCM library */
if(TextLcm_Init(nLcmType)==0)
{
printf("Unable to initialize LCM library.\n");
return;
}
/* Clear LCM. Show text "Hello" */
TextLcm_ClearScreen();
TextLcm_SetCursor(1,1);
TextLcm_printf("Hello");
}
|
| Description: | Get library version string. | ||
| Arguments: |
|
||
| Example: |
/* Show TextLCM version. */
printf("DM&P TextLCM Library Version %s\n",TextLcm_Version());
|
| Description: | Initialize text LCM and set I/O connection mode. | ||||
| Arguments: |
|
||||
| Example: |
if(TextLcm_Init(LCM_GPIO))
printf("Unable to initialize LCM library\n");
|
| Description: | Print formated string on LCM. | ||
| Arguments: |
|
||
| Example: |
TextLcm_printf("<Mity-Mite Module>\nIP:192.168.0.100");
|
| Description: | Clear LCM. |
| Arguments: | N/A |
| Example: |
TextLcm_ClearScreen();
TextLcm_printf(" |
| Description: | Set cursor position of LCM. (1,1) is left-top. | ||||
| Arguments: |
|
||||
| Example: |
TextLcm_SetCursor(1,1); |
| Description: | Move cursor left. |
| Arguments: | N/A |
| Example: |
TextLcm_CursorLeft(); |
| Description: | Move cursor right. |
| Arguments: | N/A |
| Example: |
TextLcm_CursorRight(); |
| Description: | Enable cursor. |
| Arguments: | N/A |
| Example: |
TextLcm_CursorOn(); |
| Description: | Disable cursor. |
| Arguments: | N/A |
| Example: |
TextLcm_CursorOff(); |
| DMP Electronics Inc. All rights reserved. | Email us: info@dmp.com.tw |