Skip to main content

Questions tagged [time]

Use this tag for questions regarding how to get the time on an Arduino, how to create or use clocks with an Arduino, or anything that has time as a substantial factor in it. Also consider using [programming] or other more specific tags.

Filter by
Sorted by
Tagged with
0 votes
1 answer
119 views

I am creating a three-person reaction time game but I would like to be able to read all three buttons' proximity to the start time - currently only the winner is displayed on the serial read. Here is ...
ggamalero05's user avatar
-1 votes
1 answer
137 views

I have ds3231 which i want to use to keep track of time even when the in my ase esp32 is without electricity. I however read some difference stuff regarding using the vcc and battery on he same time. ...
acroscene's user avatar
1 vote
1 answer
174 views

I was emulating the pedestrian traffic light cyclic pattern (red, green, green flashing) in the next Arduino code. But when I run this code with my ESP8266 Wemos D1 mini controller, it appears the ...
Hong Christian Lin Jiang's user avatar
0 votes
1 answer
182 views

I'm a beginner into Arduino so I have a little problem where I'm trying to do a countdown on LCD using while loop but I'm also trying to get a key input inside that same while loop. Problem is that ...
DevChips's user avatar
0 votes
2 answers
108 views

I have a question regarding serial buffer readout. At program start, I send a serial command to a sensor that 1. activates him and 2. let him send data - that works. When I unplug the sensor, the ...
Gymknopf's user avatar
0 votes
1 answer
3k views

This is a cross-post from https://github.com/espressif/arduino-esp32/discussions/8653 as it didn't yield any results there. I noticed that getLocalTime() is consistently taking 5-10+ seconds to ...
Marcel Stör's user avatar
2 votes
1 answer
114 views

I am working on a simple little robot to cure my boredom and all it has is a 64 x 32 OLED for the eyes, and a PAJ7620 Gesture recognition sensor with a Seeeduino Xiao as the main board. Basically, ...
Renier Jr.'s user avatar
-1 votes
1 answer
434 views

When I try to comapre 2 time_t values I get unexplained behavour time_t t = 12345; time_t T = 67890; struct tm *tm = localtime(&t); struct tm *Tm = localtime(&T); char timeStamp[40]; ...
guyd's user avatar
  • 1,049
2 votes
0 answers
142 views

OK, I have a little hardware issue I need to fix in software for the time being. I say, "For the time being," because I already have the PC Boards printed, and I need to make do for this ...
Leslie Rhorer's user avatar
0 votes
1 answer
1k views

I have a an arduino NANO 33 BLE and I'm trying to get the current time and date. Based on the documentation, the arduino has nRF52840 microcontroller which comes with a 24 RTC timer It is listed in ...
Riperoni's user avatar
1 vote
4 answers
3k views

With ESP8266, I noticed that for the first 1 or 2 loops, localtime returns Unix epoch (1970 date) until it has finished getting the actual time from NTP, after which point I see the real date. ...
Nick Bolton's user avatar
2 votes
1 answer
1k views

I'm making a stopwatch using an attiny85, the idea was to use the timer interrupts to count the seconds my theory was: since I set the Attiny85 to run at 1Mhz, I can use a presale of 1024; 1000000 / ...
Isael Guillén's user avatar
3 votes
0 answers
2k views

I want to synchronize time with NTP server once in some time. I am using DOIT ESP32 DEVKIT V1, I tried with getLocalTime() function but it returned true even without wifi, but as I know without wifi ...
hungryman's user avatar
1 vote
4 answers
2k views

I'm working on a battery-powered project. I'm trying to write code, which checks the battery voltage every 30 minutes and changes the color of a LED accordingly. Should I still be using millis() or is ...
Zhelyazko Grudov's user avatar
0 votes
1 answer
4k views

Why do I get wrong result when using time.h library when using AVR boards, such Nano/Uno/Pro Micro (while when using TimeLib.h). OUTPUT (for given Epoch ): TimeLib: 2022-04-02 16:11:20 time.h: 0152-03-...
guyd's user avatar
  • 1,049
2 votes
2 answers
134 views

I have code that creates a sequential signal with 4 LEDS. It cascades to the right. This works when I hold down the input button. What I need help with is having the code run exactly the same when ...
Myles's user avatar
  • 73
0 votes
1 answer
4k views

If I call configTime() on a ESP8266 using ESP8266 Core, then time() gets changed from uptime to unixtime. However this sends a SNTP request. I have a DS3231 RTC attached without internet. How can I ...
rnsi's user avatar
  • 11
0 votes
1 answer
771 views

I am logging binary data to my SD. I log a datetime object of type 'tm', which is 36 bytes on ESP32. When I create a datetime of type 'tm' on linux it is 56 bytes. ESP32 write tm to SD: [tm datetime = ...
washichi's user avatar
-1 votes
1 answer
2k views

I'm using an ESP8266 to get clock NTP sync in this manner: void myIOT2::_startNTP(const int gmtOffset_sec, const int daylightOffset_sec, const char *ntpServer) { configTime(gmtOffset_sec, ...
guyd's user avatar
  • 1,049
1 vote
1 answer
6k views

I am getting error: 'getLocalTime' was not declared in this scope when I am compiling this code for ESP8266, however works for ESP32: #include "time.h" void gettime() { static int16_t ...
Murad's user avatar
  • 11
1 vote
2 answers
517 views

i'm working on a project where i need to run a function for 20 minutes and the function writes to memory using EEPROM every minute. How can i make the function run for 20 minutes, i was thinking of ...
rohithrathod banoth's user avatar
1 vote
0 answers
202 views

Hardware- ESP8266 Based NodeMCU I am using NTP Client for time in my alarm project. I am facing an issue where NTP client is not returning proper values, in the sense that it works properly for the ...
Coder9390's user avatar
  • 512
1 vote
1 answer
3k views

I have a web service that returns timestamps in ISO 8601 format, e.g., "2021-06-25T12:00:00" I'm trying to turn the timestamp string into a tm type struct from the ESP8266 library <time.h&...
Boyfinn's user avatar
  • 245
1 vote
1 answer
205 views

I am trying to make a production counter for a machine. I want to display production count of the last minute for each seconds. So, display should update every second and should display real value of ...
user_fs10's user avatar
  • 187
1 vote
0 answers
87 views

I am trying to make a auto feeder for birds!, I can't setup my code, the aim is to move servo when the certain time comes, My commend if doesnt work, what else commend can I use? #include <Wire.h&...
matitanix's user avatar
0 votes
2 answers
94 views

I basically have two switches Both switches will be pressed simultaneously in different order I want to know which switch was pressed first
Obed's user avatar
  • 9
1 vote
2 answers
853 views

I tried the example File > Examples > ESP8266WiFi > NTPClient which requests the current time and it worked fine. Then I tried to modify it so that the ESP8266 would have a static IP ...
user avatar
2 votes
2 answers
6k views

I am making a small project, and for that, I need to measure the time between 2 inputs. basically, a program to measure the time elapsed from when digital pin 2 is high to when it again becomes high.
Chinar's user avatar
  • 21
6 votes
5 answers
3k views

I am designing an incubator system and I need to drive a motor forward and reverse every 6 hours. Is there any better choice other than using delay()? A 6-hours delay seems a little unprofessional.
henzup's user avatar
  • 63
2 votes
1 answer
289 views

I'm essentially trying to create a music box which is light activated using an LDR. When it's open a song plays, while a servo rotates a figurine back and forth, and an LED dims and illuminates in ...
TonyStark's user avatar
1 vote
0 answers
202 views

I am using the AnalogBinLogger from the SdFat example library. I am using it to record 8 analog channels at 5kHz! which is amazing (thank you SdFat). Is it possible to include a separate column to ...
Microk's user avatar
  • 115
2 votes
0 answers
76 views

I am very new to Arduino and coding/programing. I set a task for myself to make a simple circuit of 5 LEDs controlled by pins 2, 4, 8, 11, 12. I want to be able to make two different pattern for the ...
Tayler Hasson's user avatar
0 votes
2 answers
1k views

The basic example for ESP32 NTP is very rough: void setup() { Serial.begin(115200); //connect to WiFi Serial.printf("Connecting to %s ", ssid); WiFi.begin(ssid, password); while ...
Mark's user avatar
  • 393
-2 votes
1 answer
2k views

Trying to understand the two libraries and setSyncProvider(RTC.now). Using Arduino Uno with Adafruit ChronoDot. Aduino IDE 1.8.13. The code below is simply to understand what is happening. I am ...
RickH's user avatar
  • 41
1 vote
2 answers
9k views

I am using RTClib.h and TimeLib.h with an Uno. Have been struggling for days in understanding the various RTC libraries available and how to use them with the Arduino Time Library. Question 1. If I do ...
RickH's user avatar
  • 41
2 votes
1 answer
807 views

Here's what I think happens and how long it takes (FIXME means I don't know). I'd like to end up with solid max times for everything if possible. Power-on, input caps to the 328P begin charging and ...
Britton Kerin's user avatar
1 vote
0 answers
84 views

Want to use Arduino Time library and occasionally sync it with an external RTC (Maxim DS3231 chip). I am turning LEDs on and off based on time and using a shift register (Nexperia 74HC154PW) and ...
RickH's user avatar
  • 41
0 votes
1 answer
2k views

I am trying to run a DC motor for 100ms and then turn it off completely. Here is my code any suggestions on why it might not be working? My Code const int pirPin = 9; const int motorPin = 2; int ...
Erin Rehm's user avatar
3 votes
3 answers
3k views

I want to control an AC load such that it powers on for 1 minute, then turns off for 1 hour, then on again for 1 min, and so on, in a loop. I just modified the blink sketch to do: Turn A1 on Then ...
VOID seekers's user avatar
1 vote
0 answers
363 views

Hi everyone I have a project and I need to run a dc motor for amount of time without using delay I use DelayWithoutBlink technique. In this code the motor should run for 5 second in cw then it will ...
yo777's user avatar
  • 23
2 votes
1 answer
3k views

I am working on ESP32 And want to set RTC from the NTP server. How can I get epoch value I have done this thing on CC3200 launchpad and used an NTP server library to obtain epoch value.
Abdul Wasey's user avatar
0 votes
1 answer
1k views

Continuing a Question asked few days ago, answered by Edgar, a new question has rised: My goal was using a past time_t value, and convert it into a struct tm variable in order to use it, part as a ...
guyd's user avatar
  • 1,049
1 vote
2 answers
4k views

In my application, I need to keep track of the time the application has been running as well as use sleep modes. However, when using the sleep modes, Timer0 is disabled, and therefore millis stop ...
Glyn Davidson's user avatar
0 votes
1 answer
1k views

I need to create a converter from epoch time stored in a time_t variable, to a struct tm variable, in order to check / create a certain task every hour or a day. This function should get also a past ...
guyd's user avatar
  • 1,049
1 vote
1 answer
1k views

I saw that it is possible to sync time from an NTP server over WiFi. I have the HC-06 Bluetooth module and an Android phone that can share its Internet connection with Arduino via Bluetooth. Would it ...
user1876484's user avatar
0 votes
1 answer
1k views

EDIT2: Well, this is the "new" code and it just displays random dots on the matrices: #include "RTClib.h" #include <MD_Parola.h> #include <MD_MAX72xx.h> #include <SPI.h> // Define ...
Rehoboam's user avatar
1 vote
1 answer
1k views

Been struggling with something for a few days. Loading data from a website via JSON and it includes an updated date time in milliseconds. This is an EPOCH date and I can get the right value using ...
Lifesigns's user avatar
1 vote
0 answers
82 views

I'm working with a digital blood pressure meter using arduino nano. I need to display the pressure reading during inflation and deflation of the cuff instantly. And when an input signal applied to a ...
Mstar3's user avatar
  • 11
0 votes
1 answer
343 views

I am attempting to calculate the time between pulses by comparing the micros() timestamp. I understand that you cannot just simply subtract unsigned longs, but I cannot understand what the alternative ...
Andi Stancu's user avatar
0 votes
1 answer
162 views

Hello me and my friend have to do an assignment for school but we need some help. We have to make a LED turn on and of with a button and a relay. But when I press the button the LED should be on for ...
daan 's user avatar
  • 13

1
2 3 4 5