GPO Perl or C code?

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
CTMacGyver
LCD?
Posts: 4
Joined: Wed Mar 26, 2003 12:41 pm

GPO Perl or C code?

Post by CTMacGyver »

Can anyone point me in the direction of some perl or C code for turning the GPOs on or off?

Thanks in advance!

Jim
Henry
OMNIPRESENT
OMNIPRESENT
Posts: 3014
Joined: Tue Aug 14, 2001 6:00 pm
Contact:

Post by Henry »

I'm no perl expert (or even close).

First of all, all you have to do is figure out how to send to the serial port. To turn on a GPO you will need to send 2 or 3 bytes depending on what module you have...

0xFE //Command Prefix
0x56 //GPO on command
1 //for GPO #1

pretty simple really, the hard part is getting perl to format the byte properly..

syswrite DisplayIO, sprintf ("%cX", 0xfe) ; # clear LCD

the above is from a perl example in the downloads section. It clears the LCD screen by sending 2 bytes, once hex and one ASCII. That should help too.
Henry J.
President
Matrix Orbital
CTMacGyver
LCD?
Posts: 4
Joined: Wed Mar 26, 2003 12:41 pm

Post by CTMacGyver »

Thanks for the help.

I haven't had a problem clearing the display or turning the backlight on, but turning on the GPOs or setting the time off for the backlight where it carried the extra byte was confusing me.

I'll post the info here for the next guy.

One of the LCD manuals mentions that the # of the GPO needs to be specified in HEX so:

syswrite DisplayIO, sprintf ("%cW%c", 0xfe, 0x01); #Turns on GPO #1

Jim
Post Reply