Humble Pi (with LCD Display & TTL Serial Connections)
(Supplied by Ciseco)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pi@raspigrey:~$ cd ~/i2c_chips-0.0/
pi@raspigrey ~/i2c_chips-0.0 $ ./src/lcd_demo
lcd_demo.c Version 0.00 {Exp}, [28/03/2014], (c) F_Trevor_Gowen
<--| Package i2c_chips_0.0 |-->
Usage lcd_demo [Options]
Options: -a arg_filename[.arg],
-dmsg 's' {Display a MeSsaGe 'like_this_one'... - implies -W},
+S {... and Scroll right},
-E {Echo command-line arguments},
-I {Inquire about i2c devices},
-CH {Clear display & return Home - implies -W},
-F8T {Func set init 8-bit Test*},
-IG {Inquire about i2c devices & Gpio readall},
-P {Preload lcd iface},
-ST {Strobe Test*},
-WDT {Write Data Test*},
-WMT {Write Message Test - implies -W},
-WRT {Write Register Test*},
-Q {Quiet - default},
-S {use System call methods - default},
{*NB: LED Test board req'd with -S},
-T {using LED Test board},
-V {Verbose},
-W {use Wiring pi i2c methods},
-X {eXecute demonstration}.pi@raspigrey:~/i2c_chips-0.0$ ./src/lcd_demo -IG -X
lcd_demo.c Version 0.00 {Exp}, [25/03/2014], (c) F_Trevor_Gowen
<--| Package i2c_chips_0.0 |-->
<lcd_demo.arg> fopen: No such file or directory
lcd_demo.arg not found
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- 26 -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
+----------+-Rev2-+------+--------+------+-------+
| wiringPi | GPIO | Phys | Name | Mode | Value |
+----------+------+------+--------+------+-------+
| 0 | 17 | 11 | GPIO 0 | OUT | Low |
| 1 | 18 | 12 | GPIO 1 | IN | Low |
| 2 | 27 | 13 | GPIO 2 | OUT | Low |
| 3 | 22 | 15 | GPIO 3 | OUT | High |
| 4 | 23 | 16 | GPIO 4 | IN | Low |
| 5 | 24 | 18 | GPIO 5 | IN | Low |
| 6 | 25 | 22 | GPIO 6 | IN | Low |
| 7 | 4 | 7 | GPIO 7 | IN | Low |
| 8 | 2 | 3 | SDA | ALT0 | High |
| 9 | 3 | 5 | SCL | ALT0 | High |
| 10 | 8 | 24 | CE0 | IN | Low |
| 11 | 7 | 26 | CE1 | IN | Low |
| 12 | 10 | 19 | MOSI | IN | Low |
| 13 | 9 | 21 | MISO | IN | Low |
| 14 | 11 | 23 | SCLK | IN | Low |
| 15 | 14 | 8 | TxD | ALT0 | Low |
| 16 | 15 | 10 | RxD | ALT0 | High |
| 17 | 28 | 3 | GPIO 8 | ALT2 | Low |
| 18 | 29 | 4 | GPIO 9 | ALT2 | Low |
| 19 | 30 | 5 | GPIO10 | ALT2 | Low |
| 20 | 31 | 6 | GPIO11 | ALT2 | Low |
+----------+------+------+--------+------+-------+pi@raspigrey:~/i2c_chips-0.0$ ./src/lcd_demo -F8T -W -X
lcd_demo.c Version 0.00 {Exp}, [25/03/2014], (c) F_Trevor_Gowen
<--| Package i2c_chips_0.0 |-->
<lcd_demo.arg> fopen: No such file or directory
lcd_demo.arg not found
Using wiringPiI2C methods: ...
lcd iface status:
RS GPIO 27
E GPIO 22
pcf8574 chip status:
ADDR 26
QIOP ff
NAME yellow_1602
I2C Device 0x26 has i2c_chip[0].fd of 3
Using 'C' system calls to 'gpio' and wiringPi methods: ...
GPIO Pins exported:
22: out 0 none
27: out 0 none
Executed wiringPiSetupSys ... Display as seen on powering up |
|
./src/lcd_demo -WDT -W -X1 |
|
./src/lcd_demo -WMT -X3 |
|
Diagnostic "echo" of ./src/lcd_demo -F8T -W :4
pi@raspigrey:~/i2c_chips-0.0$ ./src/lcd_demo -F8T -W
lcd_demo.c Version 0.00 {Exp}, [25/03/2014], (c) F_Trevor_Gowen
<--| Package i2c_chips_0.0 |-->
<lcd_demo.arg> fopen: No such file or directory
lcd_demo.arg not found
Using wiringPiI2C methods: ...
lcd iface status:
RS GPIO 27
E GPIO 22
pcf8574 chip status:
ADDR 26
QIOP ff
NAME yellow_1602
I2C Device 0x26 has i2c_chip[0].fd of 3
wiringPiI2CWrite: fd=3 data=0xff
Using 'C' system calls to 'gpio' and wiringPi methods: ...
gpio export 27 out
gpio export 22 out
gpio exports
digitalWrite(#27, 0)
digitalWrite(#22, 0)
digitalWrite(#27, 0)
wiringPiI2CWrite: fd=3 data=0x3f
digitalWrite(#22, 0)
digitalWrite(#22, 1)
wiringPiI2CWrite: fd=3 data=0xff
digitalWrite(#27, 0)
wiringPiI2CWrite: fd=3 data=0x3f
digitalWrite(#22, 0)
digitalWrite(#22, 1)
wiringPiI2CWrite: fd=3 data=0xff
digitalWrite(#27, 0)
wiringPiI2CWrite: fd=3 data=0x3f
digitalWrite(#22, 0)
digitalWrite(#22, 1)
wiringPiI2CWrite: fd=3 data=0xff
digitalWrite(#27, 0)
wiringPiI2CWrite: fd=3 data=0x08
digitalWrite(#22, 0)
digitalWrite(#22, 1)
wiringPiI2CWrite: fd=3 data=0xff
digitalWrite(#27, 0)
wiringPiI2CWrite: fd=3 data=0x01
digitalWrite(#22, 0)
digitalWrite(#22, 1)
wiringPiI2CWrite: fd=3 data=0xff
digitalWrite(#27, 0)
wiringPiI2CWrite: fd=3 data=0x0f
digitalWrite(#22, 0)
digitalWrite(#22, 1)
wiringPiI2CWrite: fd=3 data=0xff
digitalWrite(#27, 0)
wiringPiI2CWrite: fd=3 data=0x06
digitalWrite(#22, 0)
digitalWrite(#22, 1)
wiringPiI2CWrite: fd=3 data=0xff
gpio unexportall
Third version's final display after "scrolling right" through all 26 chars. and then RETURNing HOME (1)
Without the I2C backpack (2)
Note the cursor blinking after the '!' character (3)
IE. without the -X option (4)







