Fix pca9632_set_led_color lost i2c connection (#11530)

This commit is contained in:
Shen Yiming 2018-08-13 07:05:00 +08:00 committed by Scott Lahteine
parent 77625654f4
commit 7b0a8e85ba

View File

@ -100,9 +100,9 @@ static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const
#endif #endif
void pca9632_set_led_color(const LEDColor &color) { void pca9632_set_led_color(const LEDColor &color) {
Wire.begin();
if (!PCA_init) { if (!PCA_init) {
PCA_init = 1; PCA_init = 1;
Wire.begin();
PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE1, PCA9632_MODE1_VALUE); PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE1, PCA9632_MODE1_VALUE);
PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE); PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE);
} }