From 28aacaade653fd80b9525508c0062483bf128817 Mon Sep 17 00:00:00 2001 From: Zion Orent Date: Mon, 23 Mar 2015 17:15:41 -0400 Subject: [PATCH] Jhd1313m1: extending python example for RGB display to match js/c++ examples Signed-off-by: Zion Orent Signed-off-by: Mihai Tudor Panu --- examples/python/rgb-lcd.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/examples/python/rgb-lcd.py b/examples/python/rgb-lcd.py index e65aa95f..6b14caea 100644 --- a/examples/python/rgb-lcd.py +++ b/examples/python/rgb-lcd.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # Author: Brendan Le Foll # Copyright (c) 2014 Intel Corporation. # @@ -21,5 +22,18 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import pyupm_i2clcd as lcd -x = lcd.Jhd1313m1(0, 0x3E, 0x62) -x.write('hello') + +# Initialize Jhd1313m1 at 0x3E (LCD_ADDRESS) and 0x62 (RGB_ADDRESS) +myLcd = lcd.Jhd1313m1(0, 0x3E, 0x62) + +myLcd.setCursor(0,0) +# RGB Blue +#myLcd.setColor(53, 39, 249) + +# RGB Red +myLcd.setColor(255, 0, 0) + +myLcd.write('Hello World') +myLcd.setCursor(1,2) +myLcd.write('Hello World') +myLcd.close()