Grove LCD Library

Files at this revision

API Documentation at this revision

Comitter:
DavidElmoRoss
Date:
Thu Dec 31 21:15:50 2020 +0000
Parent:
2:5ce38ef7a7db
Commit message:
Bluefruit Color Picker

Changed in this revision

Grove_LCD_RGB_Backlight.cpp Show annotated file Show diff for this revision Revisions of this file
Grove_LCD_RGB_Backlight.h Show annotated file Show diff for this revision Revisions of this file
--- a/Grove_LCD_RGB_Backlight.cpp	Tue Mar 15 18:05:14 2016 +0000
+++ b/Grove_LCD_RGB_Backlight.cpp	Thu Dec 31 21:15:50 2020 +0000
@@ -68,7 +68,24 @@
 
 
 }
+void Grove_LCD_RGB_Backlight::write(char data1)
+{
+    char data[2];
+    data[0]=0x40;
+    data[1]=(data1 >>4)+0x30;
+    i2c.write(LCD_ADDRESS,data,2);
+    data[1]=(data1&0x0f)+0x30;
+    i2c.write(LCD_ADDRESS,data,2);  
+}
 
+void Grove_LCD_RGB_Backlight::writech(char data2)
+{
+ char data[2];
+ data[0]=0x40;
+ data[1]=data2;
+ i2c.write(LCD_ADDRESS,data,2);   
+    
+}
 
 /*This function sets where on the screen the text will be written next.  It 
 takes in two values which indicate the row and column on the display that 
@@ -123,10 +140,6 @@
     setReg(0, 0);
     setReg(1, 0);
     setReg(0x08, 0xAA);   
-    
-
-
-    
-
+   
 }
 
--- a/Grove_LCD_RGB_Backlight.h	Tue Mar 15 18:05:14 2016 +0000
+++ b/Grove_LCD_RGB_Backlight.h	Thu Dec 31 21:15:50 2020 +0000
@@ -53,6 +53,13 @@
     */
     void clear();
     
+    // This function in conjunction with hex2dec will output BCD values
+    // on the LCD screen
+    void write(char data1);
+    
+    // This function will output characters both ASCII and ALTERNATE
+    void writech(char data2);
+    
     /**Prints text to the LCD display.
     * @param *str Pointer to an array of characters which will be printed to the LCD screen.
     */