Questions tagged [millis]

Is a standard library function. It returns the number of milliseconds since the Arduino board began running the current program.

Filter by
Sorted by
Tagged with
2
votes
1answer
160 views

How to start a block of code after a certain time?

I'm using a ATMega328P-PU on a breadboard as an arduino. How do you start a code after say 20 seconds have elapsed since startup? Example code:- if(condition) { //Start sending morse code! } My ...
10
votes
3answers
10k views

arduino - millis()

Copied from the Arduino reference - millis() Tip: Note that the parameter for millis is an unsigned long, errors may be generated if a programmer tries to do math with other datatypes such as ...
-1
votes
3answers
883 views

Time based scheduling, NTP vs delay()

Without asking an open-ended question, i wish to find the best way (resourcefulness) to execute methods from an arduino based on time. in a nutshell, every 10 minutes i want functionA() to be called &...
5
votes
4answers
6k views

Is `millis()` affected by long ISRs?

I have a project that uses timers and interrupts frequently. A lot of CPU time is spent handling ISRs over an extended period of time. Would this affect code inside the main loop that relies on the ...
6
votes
3answers
5k views

Visual clock with millisecond display refresh rate

I need to create a millisecond capable visual clock - I will use the clock for visual frame synchronization of multiple cameras. I found this project but it seems to use a LED display that only has ...
9
votes
2answers
4k views

Does millis() conflict with the PWM pins associated with timer 0?

I've read that the millis() function uses the same timer as a couple of PWM pins. If you're using those PWM pins, will millis() still return the correct value?
1
vote
2answers
1k views

Arduino time(milli) and pressure sensor

I've succeeded to get an Arduino to work with a pressure sensor. What I want to do is when I put pressure on the sensor, after 5 minutes the led lights on. it starts over again if there's no ...
13
votes
3answers
4k views

Is it possible to find the time taken by millis?

The function millis would be running in the span of 100+ microseconds or less. Is there a reliable way to go about measuring the time taken by a single millis call? One approach that comes to mind is ...
17
votes
5answers
9k views

How do I get an accurate time?

I've made a clock using an Arduino, but the time seems to drift. I am aware of the rollover issue; the clock seems to drift by about 15 minutes over the course of a week. I'm using a custom PCB with ...

1 2 3
4