Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
Signed-off-by: Sara Damiano <[email protected]>
  • Loading branch information
SRGDamia1 committed Oct 23, 2024
1 parent 5c7c833 commit d2a592e
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions examples/DRWI_2G/DRWI_2G.ino
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Attach the modem and information pins to the logger
dataLogger.attachModem(modem);
Expand All @@ -314,7 +314,7 @@ void setup() {
}

// Sync the clock if it isn't valid or we have battery to spare
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane()) {
if (getBatteryVoltage() > 3.55 || !loggerClock::isRTCSane()) {
// Synchronize the RTC with NIST
// This will also set up the modem
dataLogger.syncRTC();
Expand Down
4 changes: 2 additions & 2 deletions examples/DRWI_DigiLTE/DRWI_DigiLTE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Attach the modem and information pins to the logger
dataLogger.attachModem(modem);
Expand Down Expand Up @@ -379,7 +379,7 @@ void setup() {
modem.gsmModem.waitResponse(5000L, GF("OK\r"));

// Sync the clock if it isn't valid or we have battery to spare
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane()) {
if (getBatteryVoltage() > 3.55 || !loggerClock::isRTCSane()) {
// Synchronize the RTC with NIST
// This will also set up the modem
dataLogger.syncRTC();
Expand Down
4 changes: 2 additions & 2 deletions examples/DRWI_Mayfly1/DRWI_Mayfly1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Attach the modem and information pins to the logger
dataLogger.attachModem(modem);
Expand Down Expand Up @@ -360,7 +360,7 @@ void setup() {


// Sync the clock if it isn't valid or we have battery to spare
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane()) {
if (getBatteryVoltage() > 3.55 || !loggerClock::isRTCSane()) {
// Synchronize the RTC with NIST
// This will also set up the modem
dataLogger.syncRTC();
Expand Down
4 changes: 2 additions & 2 deletions examples/DRWI_Mayfly1_WiFi/DRWI_Mayfly1_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Attach the modem and information pins to the logger
dataLogger.attachModem(modem);
Expand Down Expand Up @@ -333,7 +333,7 @@ void setup() {


// Sync the clock if it isn't valid or we have battery to spare
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane()) {
if (getBatteryVoltage() > 3.55 || !loggerClock::isRTCSane()) {
// Synchronize the RTC with NIST
// This will also set up the modem
dataLogger.syncRTC();
Expand Down
2 changes: 1 addition & 1 deletion examples/DRWI_NoCellular/DRWI_NoCellular.ino
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Attach information pins to the logger
dataLogger.setLoggerPins(wakePin, sdCardSSPin, sdCardPwrPin, buttonPin,
Expand Down
4 changes: 2 additions & 2 deletions examples/DRWI_SIM7080LTE/DRWI_SIM7080LTE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Attach the modem and information pins to the logger
dataLogger.attachModem(modem);
Expand Down Expand Up @@ -361,7 +361,7 @@ void setup() {


// Sync the clock if it isn't valid or we have battery to spare
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane()) {
if (getBatteryVoltage() > 3.55 || !loggerClock::isRTCSane()) {
// Synchronize the RTC with NIST
// This will also set up the modem
dataLogger.syncRTC();
Expand Down
4 changes: 2 additions & 2 deletions examples/baro_rho_correction/baro_rho_correction.ino
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Attach the modem and information pins to the logger
dataLogger.attachModem(modem);
Expand All @@ -448,7 +448,7 @@ void setup() {
}

// Sync the clock if it isn't valid or we have battery to spare
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane()) {
if (getBatteryVoltage() > 3.55 || !loggerClock::isRTCSane()) {
// Synchronize the RTC with NIST
// This will also set up the modem
dataLogger.syncRTC();
Expand Down
7 changes: 4 additions & 3 deletions examples/data_saving/data_saving.ino
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Attach the same modem to both loggers
// It is only needed for the logger that will be sending out data, but
Expand Down Expand Up @@ -465,7 +465,7 @@ void setup() {
}

// Sync the clock if it isn't valid or we have battery to spare
if (getBatteryVoltage() > 3.55 || !loggerAllVars.isRTCSane()) {
if (getBatteryVoltage() > 3.55 || !loggerClock::isRTCSane()) {
// Synchronize the RTC with NIST
// This will also set up the modem
loggerAllVars.syncRTC();
Expand Down Expand Up @@ -575,7 +575,8 @@ void loop() {
if (Logger::markedLocalUnixTime != 0 &&
Logger::markedLocalUnixTime % 86400 == 43200) {
Serial.println(F("Running a daily clock sync..."));
loggerAllVars.setRTClock(modem.getNISTTime(), UNIX);
loggerClock::setRTClock(modem.getNISTTime(), 0,
epochStart::unix_epoch);
}

// Disconnect from the network
Expand Down
13 changes: 6 additions & 7 deletions examples/double_logger/double_logger.ino
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Begin the variable array[s], logger[s], and publisher[s]
array1min.begin(variableCount1min, variableList_at1min);
Expand All @@ -249,15 +249,13 @@ void setup() {

// Print out the current time
Serial.print(F("Current RTC time is: "));
Serial.println(
Logger::formatDateTime_ISO8601(Logger::getNowUTCEpoch(UNIX), UNIX));
Serial.println(Logger::formatDateTime_ISO8601(Logger::getNowUTCEpoch()));
Serial.print(F("Current localized logger time is: "));
Serial.println(
Logger::formatDateTime_ISO8601(Logger::getNowLocalEpoch(UNIX), UNIX));
Serial.println(Logger::formatDateTime_ISO8601(Logger::getNowLocalEpoch()));
// Connect to the network
if (modem.connectInternet()) {
// Synchronize the RTC
logger1min.setRTClock(modem.getNISTTime(), UNIX);
logger1min.setRTClock(modem.getNISTTime());
modem.updateModemMetadata();
// Disconnect from the network
modem.disconnectInternet();
Expand Down Expand Up @@ -397,7 +395,8 @@ void loop() {
// Connect to the network
if (modem.connectInternet()) {
// Synchronize the RTC
logger1min.setRTClock(modem.getNISTTime(), UNIX);
loggerClock::setRTClock(modem.getNISTTime(), 0,
epochStart::unix_epoch);
// Disconnect from the network
modem.disconnectInternet();
}
Expand Down
4 changes: 2 additions & 2 deletions examples/logging_to_MMW/logging_to_MMW.ino
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Attach the modem and information pins to the logger
dataLogger.attachModem(modem);
Expand All @@ -318,7 +318,7 @@ void setup() {
}

// Sync the clock if it isn't valid or we have battery to spare
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane()) {
if (getBatteryVoltage() > 3.55 || !loggerClock::isRTCSane()) {
// Synchronize the RTC with NIST
// This will also set up the modem
dataLogger.syncRTC();
Expand Down
4 changes: 2 additions & 2 deletions examples/logging_to_ThingSpeak/logging_to_ThingSpeak.ino
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Attach the modem and information pins to the logger
dataLogger.attachModem(modem);
Expand All @@ -312,7 +312,7 @@ void setup() {
}

// Sync the clock if it isn't valid or we have battery to spare
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane()) {
if (getBatteryVoltage() > 3.55 || !loggerClock::isRTCSane()) {
// Synchronize the RTC with NIST
// This will also set up the modem
dataLogger.syncRTC();
Expand Down
6 changes: 3 additions & 3 deletions examples/menu_a_la_carte/menu_a_la_carte.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3243,7 +3243,7 @@ void setup() {
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Serial.println(F("Setting RTC time zone"));
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

#if !defined(BUILD_MODEM_NO_MODEM)
// Attach the modem and information pins to the logger
Expand Down Expand Up @@ -3389,7 +3389,7 @@ void setup() {

/** Start [setup_clock] */
// Sync the clock if it isn't valid or we have battery to spare
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane()) {
if (getBatteryVoltage() > 3.55 || !loggerClock::isRTCSane()) {
// Synchronize the RTC with NIST
// This will also set up the modem
dataLogger.syncRTC();
Expand Down Expand Up @@ -3532,7 +3532,7 @@ void loop() {
dataLogger.watchDogTimer.resetWatchDog();
if ((Logger::markedLocalUnixTime != 0 &&
Logger::markedLocalUnixTime % 86400 == 43200) ||
!dataLogger.isRTCSane()) {
!loggerClock::isRTCSane()) {
Serial.println(F("Running a daily clock sync..."));
dataLogger.setRTClock(modem.getNISTTime(),
epochStart::unix_epoch);
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_logging/simple_logging.ino
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Set information pins
dataLogger.setLoggerPins(wakePin, sdCardSSPin, sdCardPwrPin, buttonPin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void setup() {
// Logging in the given time zone
Logger::setLoggerTimeZone(timeZone);
// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)
Logger::setRTCTimeZone(0);
loggerClock::setRTCOffset(0);

// Set information pins
dataLogger.setLoggerPins(wakePin, sdCardSSPin, sdCardPwrPin, buttonPin,
Expand Down

0 comments on commit d2a592e

Please sign in to comment.