![Portwell NAR-7070 Скачать руководство пользователя страница 74](http://html1.mh-extra.com/html/portwell/nar-7070/nar-7070_user-manual_1581805074.webp)
NAR-7070 User’s Manual
73
6.9 Sample
Code
/* *************************************
* EZIO RS232 LCD Control Sample Program
* *************************************
* *************************************************************************
* Company:
Portwell Inc.
* Date:
4/16/2003
* Program:
02A.c
* Version:
1.02
* Compile:
Linux GNU C
* Purpose:
Direct access to EZIO LCD, the program will display
*
messages according to the control button. The current
*
version only has the following function:
*
*
1:
display
welcome
message
*
2: display UP message if "scroll up" button is pressed
*
3: display ENTER message if "ENTER" button is pressed
*
4: display ESC message if "ESC" button is pressed
*
5: display DOWN message if "scroll down" button is pressed
*
* Program Overview:
*
*
- Parameters:
*
fd
: a file name for open() method, here represents the com port
*
Cmd
:
command
prefix
*
cls
:
clear
command
*
init
: initialize command
*
blank
: display blank screen
*
stopsend
: stop input/output
*
home
: move cursor to initial position
*
readkey
: set to read from EZIO
*
hide
: hide cursor & display blanked characters
*
movel
: move cursor one character left
*
mover
: move cursor one character right
*
turn
: turn on blinking-block cursor
*
show
: turn on underline cursor
*
scl
: scroll cursor one character left
*
scr
: scroll cursor one character right
*
setdis
: set character-generator address
*
* -
Procedure:
*
1. The program sets up the environment, i.e. com port settings.
*
2. The main function MUST call init() twice to initialize EZIO
*
before any communication.
*
3. For executing any command, the command prefix, Cmd, MUST be
*
called be command. So all command contains two parts, eg.
*
to initialize the sequence of HEX number is 0xFE, 0x25.
*
4. After clear screen and display welcome message, ReadKey()
*
method must be call to advise EZIO for reading data.
*
5. A pooling method is implemented to get input from EZIO while
*
any button is pressed.
*
*
- NOTE: This program is a sample program provided " AS IS" with NO
*
warranty.
*
* Copyright (c) Portwell, Inc. All Rights Reserved.
*
* ************************************************************************/