home faq download wiring lcdmodxmms links lcdmod

lcdmod

F.A.Q:
Q.  OK, I installed the module, how the hell do I use it?
A.The display should behave almost exactly like a vt52 terminal, except for a few additions for user font generation. If you just want to output text, you send ASCII to the device, to start a new line you have to send a newline and carriage-return character. eg.
	echo -en "Line One\r\nLine Two" > /dev/lcd 
will write "Line One" and "Line Two" to the first two lines of the display.
Q.When i write a new line to the screen the cursor doesn't move to the start of th line?
A.You must also send the display a carrage return, eg:
	echo -en "line1\r\nline2" > /dev/lcd 
Q.When I write more then x lines to my x line display only the last x-1 lines show up and the last line is blank?
A.If your using echo this is because echo adds a trailing newline to everything it writes, you need to use the -n argument with echo, like above.
Q.Compiling the module works fine, but when I try to insert it I get 'unresolved symbol ...'?Programming
A.This is probably because the Makefile found a different version of the kernel source from the kernel that your currently running. The best solution is to download a clean kernel source from www.kernel.org, compile it and install it, reboot your machine with the new kernel then remake the lcd module.
Q.How can I move the cursor around?PHP
A.You can put the cursor wherever you want with: ESC-Y[Y-coord+037][X-coord+037] eg.
	echo -en "\033[Y\037\037Hello" > /dev/lcd 
Will move to row 0 column 0 and print out "Hello",
	echo -en "\033[Y\040\040Hello" > /dev/lcd 
Will print the same thing at 1, 1
	echo -en "\033[Y\041\041Hello" > /dev/lcd
Will print the same thing at 2, 2
The 037 thing can be a little confusing, especially if you aren't used to octal arithmatic, in future versions I'm thinking about dropping the whole vt52 thing and replacing it with a more user friendly solution.
Q.How do I use My own fonts?
A.The HD4480 displays allow for 8 characters to be defined by the user and lcdmod supports this, but it can be rather complicated, I will write a pretty GUI to do it for you when I get round to it (or someone could write it for me? ;))
You set one character by sending the device this command, Esc-R[the font index][8 bytes defining a bitmap for that character], Only the lower 5 bits from every byte are used because the characters are 5 wide by 8 high. eg:
	echo -en "\033[R1\037\037\037\037\037\037\037\037" > /dev/lcd 
Sets the character in font index 1 to a filled in block.
	echo -en "\033[R2\037\000\037\000\037\000\037\000" > /dev/lcd
Sets the character in font index 0 to horizontal stripes.
	echo -en "\000\001\002\003\004\005\006\007" > /dev/lcd
Will print out what all the user-definable characters are currently set to. And when the module is inserted it sets them to characters useful for drawing graphs, ie. spectrum analyser.Mclellan

SourceForge.net Logo