Skip to content

Commit

Permalink
Update SetAndCalibrate.ino
Browse files Browse the repository at this point in the history
Corrected comment indentation
  • Loading branch information
SV-Zanshin authored Jan 26, 2025
1 parent 88b24d5 commit 3771829
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/SetAndCalibrate/SetAndCalibrate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ void setup() { // Arduino standard setup method
if (!deviceStatus) { // If it didn't start
Serial.println(F("Oscillator did not start, trying again.")); // Show error and
delay(1000); // wait for a second
} // of if-then oscillator didn't start
} // of while the oscillator is off
} // of if-then oscillator didn't start
} // of while the oscillator is off
MCP7940.adjust(); // Set to library compile Date/Time
Serial.println(F("Enter the following serial commands:"));
Serial.println(F("SETDATE yyyy-mm-dd hh:mm:ss"));
Expand All @@ -87,15 +87,15 @@ void setup() { // Arduino standard setup method
** and acted upon **
***************************************************************************************************/
void readCommand() {
static uint8_t inputBytes = 0; // Variable for buffer position
while (Serial.available()) { // Loop while incoming serial data
static uint8_t inputBytes = 0; // Variable for buffer position
while (Serial.available()) { // Loop while incoming serial data
inputBuffer[inputBytes] = Serial.read(); // Get the next byte of data
if (inputBuffer[inputBytes] != '\n' &&
inputBytes < SPRINTF_BUFFER_SIZE) // keep on reading until a newline
inputBytes++; // shows up or the buffer is full
inputBytes < SPRINTF_BUFFER_SIZE) // keep on reading until a newline
inputBytes++; // shows up or the buffer is full
else {
inputBuffer[inputBytes] = 0; // Add the termination character
for (uint8_t i = 0; i < inputBytes; i++) // Convert the whole input buffer
for (uint8_t i = 0; i < inputBytes; i++) // Convert the whole input buffer
inputBuffer[i] = toupper(inputBuffer[i]); // to uppercase characters
Serial.print(F("\nCommand \""));
Serial.write(inputBuffer);
Expand Down Expand Up @@ -132,7 +132,7 @@ void readCommand() {
MCP7940.adjust(
DateTime(year, month, day, hour, minute, second)); // Adjust the RTC date/time
Serial.print(F("Date has been set."));
} // of if-then-else the date could be parsed
} // of if-then-else the date could be parsed
break; //
/*******************************************************************************************
** Calibrate the RTC and reset the time **
Expand Down

0 comments on commit 3771829

Please sign in to comment.