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.
212 questions
0
votes
1
answer
109
views
How to read my three-button inputs?
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 ...
1
vote
1
answer
154
views
Fixing a pedestrian traffic light sequence pattern in a cycle using millis and without delay
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 ...
0
votes
2
answers
97
views
Serial Buffer stays empty as soon as it becomes empty once
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 ...
2
votes
1
answer
98
views
Functions delaying gesture sensor recognition
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, ...
2
votes
0
answers
141
views
I goofed: I used a digital output rather than an analog output
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 ...
1
vote
4
answers
2k
views
What is the ideal way to check if time on ESP8266 via NTP is ready?
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. ...
3
votes
0
answers
2k
views
How to correctly synchronize time with NTP server?
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 ...
0
votes
1
answer
4k
views
`time.h` vs `TimeLib.h` on AVR boards
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-...
0
votes
1
answer
4k
views
Set time() on ESP8266
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 ...
-1
votes
1
answer
2k
views
`ConfigTime` daylight saving update
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, ...
1
vote
2
answers
494
views
run a function for a certain amount of time! [duplicate]
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 ...
1
vote
1
answer
3k
views
ESP8266 ISO 8601 string to tm struct
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&...
1
vote
0
answers
82
views
Hello, help with CODE servo mechanism and DS1307
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&...
1
vote
2
answers
840
views
unable to modify NTPClient to use static IP address
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 ...
6
votes
5
answers
3k
views
Is there any better choice other than using delay() for a 6-hours delay?
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.
1
vote
0
answers
194
views
Can I record us (microseconds) with AnalogBinLogger example in SdFat's library?
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 ...
0
votes
2
answers
1k
views
ESP32 feedback from NTP
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 ...
1
vote
2
answers
8k
views
Arduino Time Library and RTC Libraries
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 ...
1
vote
0
answers
76
views
RTC and Time Library Problems
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 ...
3
votes
3
answers
3k
views
How to create a 1-hour timer with an ATtiny13A microcontroller?
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 ...
2
votes
1
answer
3k
views
How to Set RTC in ES32 using NTP server?
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.
1
vote
2
answers
4k
views
How to keep track of millis during sleep mode
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 ...
1
vote
1
answer
1k
views
Bluetooth: sync time from an NTP server via Internet connection shared with Android phone
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 ...
1
vote
1
answer
1k
views
UNIX time in ms to human date time
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 ...
0
votes
1
answer
337
views
How to subtract micros()?
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 ...