Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with setting time on arduino every #168

Open
Exeu opened this issue Dec 19, 2021 · 1 comment
Open

Issue with setting time on arduino every #168

Exeu opened this issue Dec 19, 2021 · 1 comment

Comments

@Exeu
Copy link

Exeu commented Dec 19, 2021

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

#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() {
}

Errors or Incorrect Output

Output is:
System current: 12:12:10 134 13 2021

@Makuna
Copy link

Makuna commented Jan 18, 2023

Makuna/Rtc#150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants