Class module for NCP5623B I2C LED driver
Dependents: mDotEVBM2X MTDOT-EVB-LinkCheck-AL MTDOT-EVBDemo-DRH MTDOT_BOX_EVB_Blinky ... more
Diff: NCP5623B.cpp
- Revision:
- 5:c8b00cf49c70
- Parent:
- 4:ae3ff403404a
--- a/NCP5623B.cpp Mon Oct 17 08:42:14 2016 -0500
+++ b/NCP5623B.cpp Wed Jan 31 10:15:23 2018 -0600
@@ -26,7 +26,7 @@
NCP5623B::NCP5623B(I2C &i2c)
{
- _i2c = &i2c;
+ _i2c = &i2c;
NCP5623B::init();
@@ -37,8 +37,6 @@
{
uint8_t result = 0;
- _i2c->frequency(400000);
-
// Turn off all LEDs and initialize all registers
result |= NCP5623B::writeRegister(NCP5623B::DIMDWNSET, 0x00);
result |= NCP5623B::writeRegister(NCP5623B::DIMTIME, 0x01);
@@ -130,5 +128,8 @@
result |= _i2c->write(_i2c_addr, buf, 1);
+ if (result != 0)
+ debug("NCP5623B::writeRegister error code: %d\r\n", result);
+
return result;
}