| 51 | |
| 52 | |
| 53 | bool AGS02MA::isConnected() |
| 54 | { |
| 55 | #if defined (__AVR__) |
| 56 | // TWBR = 255; // == 30.4 KHz with TWSR = 0x00 |
| 57 | TWBR = 78; // == 25.0 KHZ |
| 58 | TWSR = 0x01; // prescaler = 4 |
| 59 | #else |
| 60 | _wire->setClock(AGS02MA_I2C_CLOCK); |
| 61 | #endif |
| 62 | |
| 63 | _wire->beginTransmission(_address); |
| 64 | bool rv = ( _wire->endTransmission(true) == 0); |
| 65 | |
| 66 | #if defined (__AVR__) |
| 67 | TWSR = 0x00; |
| 68 | #endif |
| 69 | _wire->setClock(_I2CResetSpeed); |
| 70 | return rv; |
| 71 | } |
| 72 | |
| 73 | |
| 74 | void AGS02MA::reset() |