Add LCD stuff, update chad's code
This commit is contained in:
parent
1f4d02d101
commit
b46377b3f1
4 changed files with 35 additions and 1 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -1,3 +1,6 @@
|
|||
[submodule "external/happycube"]
|
||||
path = external/happycube
|
||||
url = https://github.com/happycube/misc
|
||||
[submodule "external/Adafruit_Python_CharLCD"]
|
||||
path = external/Adafruit_Python_CharLCD
|
||||
url = https://github.com/adafruit/Adafruit_Python_CharLCD
|
||||
|
|
30
NOTES/LCD.HOWTO
Normal file
30
NOTES/LCD.HOWTO
Normal file
|
@ -0,0 +1,30 @@
|
|||
From: https://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pi/usage
|
||||
|
||||
* edit /etc/modules, add i2c-bcm2708 and i2c-dev
|
||||
* sudo apt-get install i2c-tools python-smbus
|
||||
* confirm that the lcd was detected by running:
|
||||
sudo i2cdetect -y 0 (if you are using a version 1 Raspberry Pi)
|
||||
sudo i2cdetect -y 1 (if you are using a version 2 Raspberry
|
||||
you should see it show up at 0x20
|
||||
* sudo apt-get update
|
||||
* sudo apt-get install build-essential python-dev python-smbus python-pip git
|
||||
* sudo pip install RPi.GPIO
|
||||
* git clone https://github.com/adafruit/Adafruit_Python_CharLCD.git
|
||||
* cd Adafruit_Python_CharLCD
|
||||
* sudo python setup.py install
|
||||
* test by running:
|
||||
cd examples
|
||||
sudo python char_lcd_plate.py
|
||||
|
||||
Look at the contents of the char_lcd_plate.py file to see the basic usage of the character LCD plate class. The basic usage is to import the library and create an instance of the Adafruit_CharLCDPlate class. The char LCD plate class is smart enough to know how to talk to the character LCD plate without any configuration or parameters.
|
||||
|
||||
Once you have an instance of the Adafruit_CharLCDPlate class there are a few functions you can call to interact with the display:
|
||||
message(text)
|
||||
Print the provided string message to the display. The text string can include linebreak characters ('\n') and will move to the next line when found in the string.
|
||||
clear()
|
||||
Clear the display and reset the position of message printing to the first column and first line.
|
||||
set_color(red, green, blue)
|
||||
Set the color of the red, green, and blue backlight LEDs. Each color value should be a 1 for on or 0 for off. For example to set a red backlight call set_color(1,0,0) or to set a purple color call set_color(1,0,1).
|
||||
You can find a more detailed write-up of the library in this character LCD guide (see the Usage and Raspberry Pi Char LCD Plate pages).
|
||||
|
||||
more at: https://learn.adafruit.com/character-lcd-with-raspberry-pi-or-beaglebone-black/overview
|
1
external/Adafruit_Python_CharLCD
vendored
Submodule
1
external/Adafruit_Python_CharLCD
vendored
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 513307d0edc895e4279e83225b6d717b1c1f6d4c
|
2
external/happycube
vendored
2
external/happycube
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 6b1df9dff09d83ccd32cb7c12e85a6c9285db6af
|
||||
Subproject commit f9e441450b5e395c50d4ab2c48c91c488b9423e0
|
Loading…
Add table
Add a link
Reference in a new issue