Files
RTClib/examples/datecalc
Colin Grant eb805c49ed Fix examples to start Serial before checking for USB connection.
Prompted by RTClib issue #137 for PCF8523.ino, but upon inspection, all of the RTClib examples that waited for a native USB connection were checking Serial status before it was actually started.

Further, some examples exempted ESP8266 from the Serial check, others did not have a check at all.

This change standardizes the Serial opening steps across all RTClib examples.

Tested on:
Feather M4 Express w/DS1307
Feather M4 Express w/PCF8523
Feather nRF52840 Sense w/DS1307
Feather nRF52840 Sense w/PCF8523

(in the case of the DS1307, 5v power was supplied, with SDA/SCL pulled up to Feather's 3v supply)

Unfortunately, I do not have an ESP8266 or DS3231 to test with. However, all examples connected to the Arduino IDE built-in Serial monitor without issue.

Useful reference: https://www.arduino.cc/reference/en/language/functions/communication/serial/ifserial

Resolves #137
2020-04-23 00:24:21 -07:00
..