diff --git a/.gitmodules b/.gitmodules index f38e6bd..08a6b27 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/NOTES/LCD.HOWTO b/NOTES/LCD.HOWTO new file mode 100644 index 0000000..281e168 --- /dev/null +++ b/NOTES/LCD.HOWTO @@ -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 diff --git a/external/Adafruit_Python_CharLCD b/external/Adafruit_Python_CharLCD new file mode 160000 index 0000000..513307d --- /dev/null +++ b/external/Adafruit_Python_CharLCD @@ -0,0 +1 @@ +Subproject commit 513307d0edc895e4279e83225b6d717b1c1f6d4c diff --git a/external/happycube b/external/happycube index 6b1df9d..f9e4414 160000 --- a/external/happycube +++ b/external/happycube @@ -1 +1 @@ -Subproject commit 6b1df9dff09d83ccd32cb7c12e85a6c9285db6af +Subproject commit f9e441450b5e395c50d4ab2c48c91c488b9423e0