Open Exeu opened 2 years ago
using setTime causes wiered results on printing time on an arduino nano every.
Output is: System current: 12:12:10 134 13 2021
System current: 12:12:10 134 13 2021
Day would be 134 and month is 13. Expected: Day 11 and month 6
simply set the time using setTime and compare the time set with the time you get from the time functions.
Visual Studio Code (newest version) with platform io Arduino Nano Every
#include <Wire.h> // must be included here so that Arduino library object file references work #include <RtcDS3231.h> #include <RotaryEncoder.h> #include "Arduino.h" #include "FastLED.h" #include <TimeLib.h> void setup() { setTime(12, 12, 10, 11, 6, 2021); Serial.print("System current: "); // digital clock display of the time Serial.print(hour()); printDigits(minute()); printDigits(second()); Serial.print(" "); Serial.print(day()); Serial.print(" "); Serial.print(month()); Serial.print(" "); Serial.print(year()); Serial.println(); } void loop() { }
https://github.com/Makuna/Rtc/discussions/150
Description
using setTime causes wiered results on printing time on an arduino nano every.
Output is:
System current: 12:12:10 134 13 2021
Day would be 134 and month is 13. Expected: Day 11 and month 6
Steps To Reproduce Problem
simply set the time using setTime and compare the time set with the time you get from the time functions.
Hardware & Software
Visual Studio Code (newest version) with platform io Arduino Nano Every
Arduino Sketch
Errors or Incorrect Output
Output is:
System current: 12:12:10 134 13 2021