Difference between revisions of "Raspberry Pi LCD program"

From BitWizard WIKI
Jump to: navigation, search
(Command line arguments)
Line 1: Line 1:
 
== Command line arguments ==
 
== Command line arguments ==
  
-a <addr>          address of display, defaults to 0x82
+
  SPI options:
-p <l> <c>        Jump to line <l> and character <c>
+
  -D <device>      SPI device to use. default: /dev/spidev0.0
-t <text>          print text
+
  -s <speed>        speed to use on the SPI bus default 0.5MHz.
-T <l> <c> <text>  Print tekst  
+
  -d <delay>        delay between bytes. default: 15 us.
-b <>             Adjust backlight level
+
 
-C <>             Adjust contrast
+
  -a <addr>          address of display, defaults to 0x82
-r                 clear/reset/reinitialise? display
+
  -p <c>,<l>        Jump to line <l> and character <c>
-f <file>          display text from file
+
  -t <text>          print text
 +
  -T <c>,<l> <text>  Print tekst starting at line <l> character <c>.
 +
  -b <b>             Adjust backlight level
 +
  -c <c>             Adjust contrast
 +
  -C                 clearscreen
 +
  -f <file>          display text from file (not implemented yet).
  
 
== Example commands ==
 
== Example commands ==

Revision as of 15:03, 6 June 2012

Command line arguments

 SPI options: 
 -D <device>       SPI device to use. default: /dev/spidev0.0
 -s <speed>        speed to use on the SPI bus default 0.5MHz. 
 -d <delay>        delay between bytes. default: 15 us. 
 -a <addr>          address of display, defaults to 0x82
 -p <c>,<l>         Jump to line <l> and character <c>
 -t <text>          print text
 -T <c>,<l> <text>  Print tekst starting at line <l> character <c>. 
 -b              Adjust backlight level
 -c <c>             Adjust contrast
 -C                 clearscreen 
 -f <file>          display text from file (not implemented yet).

Example commands

Print current date on line 0:

LCD -p 0 0 -t `date +%m/%d/%Y`

Print the text "Hello World" on line 1, character 2:

LCD -T 1 2 "Hello World"

Print the contents of "textfile":

LCD -f textfile

Write two different strings to two daisy-chained displays:

LCD -a 82 -l 0 -c 0 -t display0
LCD -a 84 -l 0 -c 0 -t display1