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.
Dependents: m3Dpi kousenMusicGame-test
Revision 1:c285b2c57b2e, committed 2015-12-19
- Comitter:
- sillevl
- Date:
- Sat Dec 19 10:41:07 2015 +0000
- Parent:
- 0:52a1996ad711
- Commit message:
- add constructor that accepts I2C object
Changed in this revision
| TLC59116.cpp | Show annotated file Show diff for this revision Revisions of this file |
| TLC59116.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/TLC59116.cpp Thu Dec 03 07:57:50 2015 +0000
+++ b/TLC59116.cpp Sat Dec 19 10:41:07 2015 +0000
@@ -1,8 +1,17 @@
#include "TLC59116.h"
+TLC59116::TLC59116(I2C &_i2c, int _address): i2c(_i2c), address(_address)
+{
+ initialize();
+}
TLC59116::TLC59116(PinName sda, PinName scl, int _address): i2c(sda, scl), address(_address)
{
+ initialize();
+}
+
+void TLC59116::initialize()
+{
// oscillator set to normal mode
enable();
// enable individual brightness and group dimming
--- a/TLC59116.h Thu Dec 03 07:57:50 2015 +0000
+++ b/TLC59116.h Sat Dec 19 10:41:07 2015 +0000
@@ -4,6 +4,8 @@
class TLC59116{
public:
+
+ TLC59116(I2C &i2c, int address);
TLC59116(PinName sda, PinName scl, int address);
void setBrightness(float brightness);
@@ -15,6 +17,8 @@
int address;
I2C i2c;
+ void initialize();
+
void setOutputState(int ledout0, int ledout1, int ledout2, int ledout3);
private: