diff --git a/lib/HM330x/HM330x.cpp b/lib/HM330x/HM330x.cpp index 7e6e0ef..af6364c 100644 --- a/lib/HM330x/HM330x.cpp +++ b/lib/HM330x/HM330x.cpp @@ -39,10 +39,12 @@ void HM330x::initialize(void) { DEBUG_PRINTLN("HM330x::initialize"); // Send select command while (!sendCmd(HM330x_SELECT)) { - if (retryCount++ >= 0) { + if (retryCount++ >= 10) { + DEBUG_PRINTLN("HM330x::initialize Select Failed!"); return; } else { - delay(100); + delay(500); + DEBUG_PRINTLN("HM330x::initialize Retrying Select..."); } } } @@ -61,8 +63,13 @@ uint8_t HM330x::getSensorData(char *payload, uint8_t startbyte) { // Get Data from the Sensors Wire.requestFrom(HM330x_ADDR, HM330x_DATA_LEN); if (Wire.available()) { - for (uint8_t i = 0; i