I have two variations of a similar sketch that use two different Real Time Clocks.
The library being used is the Adafruit RTClib fork.
In the initial part of the sketch the type of RTC is declared
// Create DS1307 or PCF8523 object. // RTC_PCF8523 rtc; // used with the Adalogger FeatherWing which has a RTC and SD card holder incorporated. RTC_DS1307 rtc;
During the setup I would like to include an if statement that performs a function dependant on which type of RTC is used…
Obviously I could comment out the unrequired code, in the same way that I have commented out the unrequired RTC object above, but it seems to me that there should be a way of finding out how the rtc object was defined.
Any suggestions would be appreciated.
Sorry if I have not used quite the correct terms, I am still coming to grips with C++ programming. :o