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
1
vote
0
answers
60
views
I need to happen a process between 2 given times in Arduino
In my project i have a function which i only need to execute if the current time is between given 2 times. Note that the time is fetched from RTC so its 24hr. For example if current time is 23:00,...
0
votes
1
answer
1k
views
How to set a time out like Serial.setTimeout() for Serial.read()?
I read a comment form here:
"Serial.setTimeout() sets the maximum milliseconds to wait for serial data when using Serial.readBytesUntil(), Serial.readBytes(), Serial.parseInt() or Serial.parseFloat()...
1
vote
1
answer
17k
views
ESP32 documentaiont for "time.h"
I am working from the example sketch in that installed with the ESP32 Dev Module into the Arduino IDE. It includes <WiFi.h> and "time.h". I have a number of questions about how to use the ...
1
vote
1
answer
6k
views
ESP32 seconds from epoch
When using ESP8266 - getting seconds from epoch is done using
NTP.begin(NTPserver, 2, true);
delay(delay_tries);
time_t t = now();
while t stores amount of seconds from 1-1-1970.
When trying to do ...
0
votes
1
answer
469
views
When does the ADC take the reading?
I'm experimenting with the "2 pin capacitance meter" and trying to make it more accurate. Currently I've made the Arduino read 62.5 ns intervals but this means the time for the ADC to read is taking ...
1
vote
2
answers
5k
views
Converting human readable date to a unix timestamp [duplicate]
Can anyone provide a sample code that would convert a human readable date like 2019-10-27 22:10:35 to a unix timestamp like 1572214235?
I found many topics about it, but they eider refer to out of ...
-1
votes
1
answer
520
views
how to convert date to timestamp? [duplicate]
How should I convert date format(dd-mm-yyyy) to timestamp value . Can anyone suggest code how to convert and where to put code .
1
vote
3
answers
243
views
When GPS can't see satellites, how can I continue to tick off a smooth-ish time?
I'm getting 10 updates/sec from my GPS unit (The MTK3339 used in the Adafruit breakout board), and using it to update a clock display. This works well enough, though there's one minor problem that I'd ...
0
votes
1
answer
233
views
Arduino is running as a server, but want to occasionally act as a client to update time
My Arduino (actually an ESP32-based Adafruit HUZZAH32) is running as a wifi server. Its main job is to service GET requests from a user, and to periodically turn devices on and off based on the ...
1
vote
1
answer
157
views
RDTSC alternative for Arduino
To calculate an operation execution time, I was saving the millis() result before and after the operation to calculate the interval time. Is there an alternative on the Arduino Uno like the RDTSC ...
2
votes
1
answer
610
views
NTP rollover-safe design with ESP8266 (Curiosity)
The Arduino NTP implementation is rather naive in some respects. It basically just grabs the time in seconds from the raw packet, and then converts it to Unix time via subtraction. How would it be ...
0
votes
2
answers
395
views
Is there a way to get my MacBook's date and time into Arduino IDE?
I am using a DS3231 RTC module. It requires to set the time every time it is reset. I was wondering if I could read my MacBook's time and date and feed into the module at the setup stage. Is this ...
0
votes
1
answer
536
views
Verifiy NTP server update - at start
I have function to start an NTP service, right after obtaining wifi connection ( using ESP8266 board ).
from time to time, I get an error saying date and time is01-01-1970... which I assume is due to ...
4
votes
2
answers
23k
views
How to converte EPOCH time into time and date on Arduino?
I have a question on how to convert EPOCH timestamps, which I receive as char*, into DD.MM.YYYY and HH:MM:SS format separately?
Here is more information on my Arduino project: The Arduino is receiving ...
0
votes
1
answer
120
views
Loops fail after ~5 minutes when making two API calls every 10 seconds using WiFi client
I am running into an issue with a loop call on an Arduino MKR1000. I have tried the solutions suggested in this question and it usually works for 5 minutes and then collapses. I am trying to make two ...
0
votes
1
answer
645
views
TimeAlarms stops working when using setSyncProvider(RTC.get) DS1307
Been working on this project for some time now, like title states when I un-comment setSyncProvider(RTC.get) in the setup the program fails to get any of the Alarm.timerOnce to run.
I have been stuck ...
1
vote
2
answers
1k
views
Getting FFT arduino code to run over 9+ hours, utilizing micros()
I am a beginner in Arduino, coding, and electrical engineering (learning on my own time) and am working on creating an EEG. I've got the hardware down and have managed to get numerical data output ...
0
votes
2
answers
277
views
Parse UNIX-time from char[]
I want to parse a large number to sync time on my arduino. For this i send it a string with the current time in Unix time format wich looks somethink like this:
1535441277
For this I just call a php ...
1
vote
7
answers
6k
views
How to parse 20180810T143000Z to time_t
What is the shortest/most elegant way (i.e. use existing lib functions) to parse a string in the form of 20180810T143000Z to a time_t? Note that the literal always represents a UTC timestamp.
I ...
1
vote
1
answer
2k
views
Arduino - Calculating the time for which a Pushbutton is pressed and held without being released
I'm working on a project that requires calculating the time for which a pushbutton is kept pressed without being released. Is there a code snippet that i can use for this particular need ?
1
vote
2
answers
368
views
Need Input: Wait for voltage input to begin script & when voltage maintains 0V for X amount of time Reset and wait for Voltage Input
So I'm currently working on an automotive set up.
I'm using a 555 timer to emulate a turn-signal alternating voltage pulse (12V to 0V and repeat) for debugging purposes which is output to turnPin/A1.
...
0
votes
2
answers
91
views
Tian stops working after some hours
I'm having a very strange problem. I have a Tian that is programmed to send out sensor data to a server
every x seconds.
My program run well but after 14,15 hours of operation it stops working and I ...
2
votes
0
answers
111
views
Storing random and different values of millis() while inside a loop? [closed]
Is it possible to store a value of time while you're inside a loop? Entertain the condition:
if (condition && value > 0)
{
timeTrans = millis() + 2000;
timeTrans - millis() = value;
}
...
0
votes
1
answer
1k
views
Is it possible to disable functions/methods?
I recently started using the TimeAction library (which allows for proto-threading) and I noticed it has a really useful function for enabling/disabling threads. I want to use the same idea but apply ...
0
votes
2
answers
1k
views
Alternative of relay
I am carrying out a physics experiment using an Arduino. This experiment requires accurate time measurements of upto a millisecond. However I am using a relay to turn on/off an electromagnet and there ...