Support for the AdaFruit_RGBLCDShield. Uses MCP23017 for control of the port expander. Code intentionally kept as close to the Arduino code released by AdaFruit to make updates easier.

Dependents:   AdaFruit_RGBLCD

Files at this revision

API Documentation at this revision

Comitter:
vtraveller
Date:
Sat Aug 30 16:29:58 2014 +0000
Parent:
1:24ab601221e2
Commit message:
Updated with support for MCP9080 Adafruit sensor.

Changed in this revision

AdaFruit_RGBLCDShield.cpp Show annotated file Show diff for this revision Revisions of this file
Adafruit_RGBLCDShield.h Show annotated file Show diff for this revision Revisions of this file
diff -r 24ab601221e2 -r 01f8491ca9a5 AdaFruit_RGBLCDShield.cpp
--- a/AdaFruit_RGBLCDShield.cpp	Mon Aug 11 19:09:40 2014 +0000
+++ b/AdaFruit_RGBLCDShield.cpp	Sat Aug 30 16:29:58 2014 +0000
@@ -92,6 +92,36 @@
   // we can't begin() yet :(
 }
 
+Adafruit_RGBLCDShield::Adafruit_RGBLCDShield
+(
+    MCP23017 &  inMCP,
+    uint8_t     inRs,
+    uint8_t     inRw,
+    uint8_t     inEn,
+    uint8_t     inD4,
+    uint8_t     inD5,
+    uint8_t     inD6,
+    uint8_t     inD7
+)
+    : Serial(SERIAL_TX, SERIAL_RX)
+    , _i2c(inMCP)
+{
+  _i2cAddr = 0;
+
+  _displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS;
+  
+  // the I/O expander pinout
+  _rs_pin = inRs;
+  _rw_pin = inRw;
+  _enable_pin = inEn;
+  _data_pins[0] = inD4;  // really d4
+  _data_pins[1] = inD5;  // really d5
+  _data_pins[2] = inD6;  // really d6
+  _data_pins[3] = inD7;  // really d7
+  
+  // we can't begin() yet :(
+}
+
 void Adafruit_RGBLCDShield::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable,
              uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
              uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
diff -r 24ab601221e2 -r 01f8491ca9a5 Adafruit_RGBLCDShield.h
--- a/Adafruit_RGBLCDShield.h	Mon Aug 11 19:09:40 2014 +0000
+++ b/Adafruit_RGBLCDShield.h	Sat Aug 30 16:29:58 2014 +0000
@@ -69,6 +69,18 @@
 public:
     // Updated constructor
   Adafruit_RGBLCDShield(MCP23017 & inMCP);
+  Adafruit_RGBLCDShield
+  (
+    MCP23017 &  inMCP,
+    uint8_t     inRs,
+    uint8_t     inRw,
+    uint8_t     inEn,
+    uint8_t     inD4,
+    uint8_t     inD5,
+    uint8_t     inD6,
+    uint8_t     inD7
+  );
+
 
   void init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable,
         uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,