SO1602A Lib. SO1602A is Organic LED, has 16 chars and 2 lines. This lib supports printf() of C-Language. http://akizukidenshi.com/catalog/g/gP-08276/
Dependents: NEW_LineTraceHub NEW_LineTraceHub_2 ColorSensorTest
Diff: SO1602A.cpp
- Revision:
- 4:e17943b827d8
- Parent:
- 3:eaaedd09fa6b
--- a/SO1602A.cpp Mon Oct 19 05:44:49 2015 +0000 +++ b/SO1602A.cpp Fri Nov 06 06:23:52 2015 +0000 @@ -1,15 +1,20 @@ #include "SO1602A.h" SO1602A::SO1602A (PinName sda, PinName scl, char address) - : i2c(sda, scl), addr(address) + : p_i2c(new I2C(sda, scl)), i2c(*p_i2c), addr(address) { init(); } SO1602A::SO1602A (I2C &_i2c, char address) - : i2c(_i2c), addr(address) + : p_i2c(NULL), i2c(_i2c), addr(address) { init(); } +SO1602A::~SO1602A() +{ + if(p_i2c != NULL) + delete p_i2c; +} bool SO1602A::cmd(char chr) {