MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / isConnected

Method isConnected

libraries/AGS02MA/AGS02MA.cpp:53–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52
53bool 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
74void AGS02MA::reset()

Callers 1

unittestFunction · 0.45

Calls 1

setClockMethod · 0.80

Tested by 1

unittestFunction · 0.36