ACS Graphical LCD

From Nerdwiki

Jump to: navigation, search

Acsdisplay.jpg

Contents

Info

From webpage:

Our Serial 128 x 64 Graphic LCD RS-232 Display Terminal is designed to provide a cost effective RS-232 operator interface.
A high contrast, extended temperature range 128 x 64 pixel LED backlight transflective LCD provides excellent viewing in 
direct light, as well as indoors. It has a 12:00 to 6:00pm viewing angle, which means it can be viewed from straight on to 
about 80 degress downward. The backlight automatically turns on when characters are received or inputs are activated, and 
shuts off after a programmable amount of no use. You can use your choice of matrix or non-matrix keypads, allowing 7 to 12 
inputs. An on board tone generator & amplifier can be used to provide user feedback. Built in, expandable EEPROM's allow 
storing of graphics pages for quick menu redraws and graphics animation.

Sold by [ACSControl USA]


Configuration

- While powered up, hold down the reset button located at the back. - Push buttons 1 and 4, release the reset button.

Remember to save changes.

Protocol

Data sent to and from the display needs to have a start and stop symbol. ACS uses ascii 1 as start and ascii 3 as stop.

Full overview of the protocol is found [here]

Example

From command line

echo -e "\x01P0100010String\x03" >/dev/ttyS0

Quick and dirty php example to write hello world on top line.

<?
$disp=fopen("/dev/ttyS0", "w+");
fwrite($disp, chr(1));
fwrite($disp, "P0000010 HELLO WORLD!");
fwrite($disp, chr(3));
fclose($fp);
?>

And how to read buttons in php. $keys are numbered 30 to 37. PS! The use of K command will only work if Switches polled is set to 1 in config.

<?
$disp=fopen("/dev/ttyS0", "w+");
while ( 1 == 1 ){
fwrite($disp, chr(1));
fwrite($disp, "K");
fwrite($disp, chr(3));
$bogus=fread($disp, 1);
$data=fread($disp, 1);
$test=ord($data);
if ( $test != 21 )
     $keypress=fread($disp, 2);
else $keypress=0;

if ( $keypress != 0 )
     print "Key pressed: $keypress\n";

}
?>

Personal tools