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
0
votes
1answer
163 views

millis() replace delay() question

// each "event" (LED) gets their own tracking variable unsigned long previousMillisLED12=0; unsigned long previousMillisLED13=0; unsigned long previousMillisLED3=0; // different intervals for each ...
0
votes
1answer
1k views

uno timer0 prescale

I have a project where I need to get a low frequency to get a pwm suited from my project. The problem is that after I modify the frequency of timer0 the millis() becomes slower or faster depending on ...
0
votes
1answer
644 views

Countdown sometime stop

I've made a game with 3 countdowns and 1 global countdown. When we start, the global one, go from 45:00 to 00:00. The 1 go from 15:00 to 00:00 and if it reach 00:00: The 2 start and go from 15:00 to ...
0
votes
1answer
100 views

ESP32 millis not working properly

I have a program which measures temperatures every 30 minutes and sends them to a database. Immediately after running the program the first measurement is sent, however, the second (which should be ...
0
votes
1answer
1k views

Help me restructure code for multitasking Neopixel + IR remote + arduino

First of all, I'm completely new to both arduino, and programing. Second, as for a good newbie, i'm trying to build a fairly complicated project. So, any help and suggestion is welcome. The goal is: ...
-1
votes
2answers
304 views

Arduino millis() fuction execution problem

I am new to Arduino development. I want to use millis function instead of delay because delay is blocking further execution of program. Program description: In this code I want to control 2 solenoid ...
-1
votes
3answers
886 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 &...
-1
votes
2answers
107 views

Display a Random Number to Display for T Seconds With Millis() for Dice Roller

I'm coding an electronic dice roller for a project. At the press of a push button (A2), the code must display a random number to the two digit seven segment display for 20 seconds, then display blank. ...
-1
votes
2answers
65 views

buiReliable time in ISR

I'm using a Nano. The code below is a simplified workup of my problem code. The point of it is asynchronous debounced button press detection. The actual code sets a volatile bool to tell the main ...
-1
votes
1answer
203 views

Using mills() in place of delay() on relays not getting solid switch over

I know I should post some code that maybe cleaner but really I am just in need of a answer to a problem I seem to run into a lot when using mills() in place of delay(), whilst making a Christmas light ...
-1
votes
1answer
425 views

How to use millis instead of delay on Arduino for independent time intervals for two output pins

I wanted to use millis for the code below but stuck in between . can anyone help to change the given code to millis? Code here: void set(){ digitalWrite(on, HIGH); // turn the motor on (...
-2
votes
1answer
418 views

Arduino millis() won't work

This is my program. The LED should turn off after four seconds. int vraag = 7; int gloeikaars = 5; unsigned long previousMillis3; boolean gloeistate = true; void setup() { pinMode(gloeikaars, ...

1 2 3
4