Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: AdaFruit_RGBLCDShield MCP23017 mbed RTclock
Fork of MCP_test by
Diff: AdaFruit_RGBLCDShield.cpp
- Revision:
- 5:6c9ee7e3a20c
- Parent:
- 4:d70e37f6c6bd
- Child:
- 6:a6be2aede8f2
diff -r d70e37f6c6bd -r 6c9ee7e3a20c AdaFruit_RGBLCDShield.cpp
--- a/AdaFruit_RGBLCDShield.cpp Sat Aug 02 13:50:40 2014 +0000
+++ b/AdaFruit_RGBLCDShield.cpp Sat Aug 02 14:16:30 2014 +0000
@@ -28,7 +28,9 @@
#define delayMicroseconds(a) wait(a / 1000000)
-/* Remove Arduino i2c (wire) interface
+/* MBED TURNED OFF
+
+Arduino i2c (wire) interface
#include <Wire.h>
#ifdef __AVR__
@@ -63,6 +65,8 @@
// can't assume that its in that state when a sketch starts (and the
// RGBLCDShield constructor is called).
+// MBED - wired in serial
+// MBED - wired in _i2c
Adafruit_RGBLCDShield::Adafruit_RGBLCDShield(MCP23017 & inMCP)
: Serial(SERIAL_TX, SERIAL_RX)
, _i2c(inMCP)
@@ -128,7 +132,7 @@
if (_i2cAddr != 255) {
//_i2c.begin(_i2cAddr);
//WIRE.begin();
- //_i2c->begin();
+ _i2c.reset();
_i2c.pinMode(8, OUTPUT);
_i2c.pinMode(6, OUTPUT);
@@ -143,12 +147,14 @@
for (uint8_t i=0; i<4; i++)
_i2c.pinMode(_data_pins[i], OUTPUT);
+ unsigned short nPullups = 0;
for (uint8_t i=0; i<5; i++) {
_i2c.pinMode(_button_pins[i], INPUT);
+ nPullups |= (1 << _button_pins[i]);
//_i2c.pullUp(_button_pins[i], 1);
}
- _i2c.internalPullupMask(0xffff);
+ _i2c.internalPullupMask(nPullups);
}
if (lines > 1) {
@@ -349,7 +355,7 @@
_i2c.digitalWrite(p, d);
} else {
// straightup IO
- // @@@ TURNED OFF @@@
+ // MBED TURNED OFF
//digitalWrite(p, d);
}
}
@@ -369,7 +375,7 @@
_i2c.pinMode(p, d);
} else {
// straightup IO
- //@@@ TURNED OFF @@@
+ // MBED TURNED OFF
//pinMode(p, d);
}
}
