| 56 | |
| 57 | |
| 58 | bool AM232X::isConnected(uint16_t timeout) |
| 59 | { |
| 60 | uint32_t start = micros(); |
| 61 | while (micros() - start < timeout) |
| 62 | { |
| 63 | _wire->beginTransmission(AM232X_ADDRESS); |
| 64 | if ( _wire->endTransmission() == 0) return true; |
| 65 | yield(); |
| 66 | delayMicroseconds(100); |
| 67 | } |
| 68 | return false; |
| 69 | } |
| 70 | |
| 71 | |
| 72 | int AM232X::read() |