2021-05-16 13:21:38 +02:00
|
|
|
//
|
|
|
|
// FILE: LTC2991_demo.ino
|
|
|
|
// AUTHOR: Rob Tillaart
|
|
|
|
// PUPROSE: detect device on I2C bus
|
|
|
|
|
|
|
|
|
|
|
|
#include "Wire.h"
|
|
|
|
#include "LTC2991.h"
|
|
|
|
|
2023-03-06 18:46:47 +01:00
|
|
|
LTC2991 LTC(0x48); // all address lines GND
|
|
|
|
|
2021-05-16 13:21:38 +02:00
|
|
|
|
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
|
|
|
Serial.println(__FILE__);
|
|
|
|
Serial.print("LTC2991_LIB_VERSION:\t");
|
|
|
|
Serial.println(LTC2991_LIB_VERSION);
|
|
|
|
|
|
|
|
Wire.begin();
|
|
|
|
Wire.setClock(100000);
|
|
|
|
LTC.begin();
|
2023-03-06 18:46:47 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void loop()
|
|
|
|
{
|
2021-05-16 13:21:38 +02:00
|
|
|
while (!LTC.isConnected())
|
|
|
|
{
|
|
|
|
Serial.println("Could not connect to device");
|
|
|
|
delay(2000);
|
|
|
|
}
|
|
|
|
|
2023-03-06 18:46:47 +01:00
|
|
|
Serial.print(millis());
|
|
|
|
Serial.print("\taddress: ");
|
|
|
|
Serial.println(LTC.getAddress());
|
|
|
|
|
|
|
|
delay(2000);
|
2021-05-16 13:21:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-01-23 13:59:35 +01:00
|
|
|
// -- END OF FILE --
|
2021-12-20 20:24:00 +01:00
|
|
|
|