Mini-HOWTO for mod-lcd device driver

Author: Marcus Berglf
Contact: pacman@linux.se
License: GPL

- 


CONTENT

1. Authors word
2. WTF?
3. The Codes (Qiuck'n'Dirty)
4. Examples




1. Authors word

	It seemed like a good idea to document these escape-sequences which controls how the 
	text is displayed on the LCD. The first time I played around with this excellent piece 
	of software I got some text stuck on the display, after	running the included 
	example-script. After some reading in the source i found what i was looking for...

	So this is for all of you out there which isn't used to reading/coding C/C++ ;-)


2. Wtf?

	Yup, this is the "WTF?" section where I'll try to explain what I've discovered so far.
	Assuming you're using good old 'echo' to feed your LCD with text, add '-ne' as option!

	First you play around, writing your name and other silly things, and suddenly the text
	or a part of it stucks on the screen... here is where you say "WTF?!" ;-)

	So now you'll need a way to clear the screen, using 'echo' it's simply:
	prompt~$> echo -ne "\033[H\033[J" > /dev/lcd

	And now I'll get to the point where it's time to explain all those funny \033['s...


3. ESC-Sequences for controlling your nice little LCD

	\033	= Sends ESC, which all special commands begin with.
	[A	= Move the cursor up one row.
	[B	= Move the cursor down one row.
	[C	= Move the cursor right one position. 
	[D	= Move the cursor left one position.
	[H	= Move the cursor home, to the upper left corner (position 0,0)

	[J	= Erase everything, does NOT move the cursor home!
	[K	= Erase to end of line, does NOT move the cursor home!
	[M	= Map character (haven't tried this one)
	[Y	= Direct access to position, this is documented on the site
		  http://lcd-mod.sf.net/
	[R	= CGRAM Select (haven't tried this one)
	[V	= Linewrap ON
	[W	= Linewrap OFF
	[b	= Toggle backlight ON/OFF


Other useful positioning command, these are NOT prepended with \033! 
	
	\r 	= Carriage return (return cursor to position 0 on current line!)
	\n	= Newline
	\t	= Tab (Default 3 positions)


4. Examples

	Here are some hands-on examples...

	Clear the screen, move the cursor home (For those who skipped right too section 3).
	echo -ne "\033[H\033[J" > /dev/lcd
		

