| 37 | |
| 38 | #if defined(ESP8266) || defined(ESP32) |
| 39 | bool AM2315::begin(const uint8_t dataPin, const uint8_t clockPin) |
| 40 | { |
| 41 | if ((dataPin < 255) && (clockPin < 255)) |
| 42 | { |
| 43 | _wire->begin(dataPin, clockPin); |
| 44 | } else { |
| 45 | _wire->begin(); |
| 46 | } |
| 47 | if (! isConnected()) return false; |
| 48 | this->read(); |
| 49 | return true; |
| 50 | } |
| 51 | #endif |
| 52 | |
| 53 |