Questions tagged [delay]
The delay tag has no summary.
13 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
77
views
How does `delay()` differ from using `millis()` in terms of processor efficiency and responsiveness?
In many Arduino sketches, especially beginner ones, delay() is commonly used to pause between actions. However, Iβve seen more advanced projects use millis() instead to handle timing.
From a ...
0
votes
2
answers
100
views
Difference Between delay() and a while Loop with millis() in Arduino?
What are the practical differences between using delay() versus a while loop with millis() for timing in Arduino projects? I assumed both methods are blocking, but I'm not completely sure.
Example ...
1
vote
1
answer
171
views
Water pump relay switching too fast
I'm using a water level sensor with two outputs, a 5V fan and a water pump. Here's the wiring .
What I want to do with this project is:
When the water reaches 2 cm, then the water pump is on while ...
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, ...
0
votes
1
answer
196
views
Using Millis instead of delay to reboot relay
I want to reboot relay (turn off , waiting 4 seconds and turn ON)
it works perfectly if I use delay(4000), but code is blocked while delay (4 seconds) and I cant start relay 2.
How can I use Millis ...
0
votes
1
answer
614
views
Tone() function pauses between notes
I tried to experiment with the tone() function that comes with the arduino library.
I played around with the standard code example located here:
https://www.arduino.cc/en/Tutorial/BuiltInExamples/...
0
votes
3
answers
799
views
Using 1 ms delay() in a for loop to check inputs.. Bad?
So first off, I know millis() exists. Just asking out of curiosity. Say you have a button you wanna check for during a delay.. Maybe a 10 second delay. So you make a for loop that checks for input and ...
0
votes
1
answer
404
views
Question about using millis for alarm conditions - Arduino
I am new to programming in general and to Arduino as well.
I am working on a small project to improve my ability to write complete and kind of useful programming sketches.
I am facing a problem. I am ...
2
votes
0
answers
56
views
How to input delay and increase volume measurements with hall sensor detection
I'm writing code so that, every time a hall monitor senses, my code additively measures 5 liters of volume as it prints each detection. Then, this data is sent via Bluetooth to a phone. (This is for a ...
0
votes
1
answer
3k
views
Random "Compilation error: Error: 13 INTERNAL: exit status 1". No clue how to resolve or even what causes this error
I am a beginner with Arduino. I have a program that is intentionally simple.
The code refuses to compile, spitting out the error Compilation error: Error: 13 INTERNAL: exit status 1. I have gotten ...
2
votes
1
answer
631
views
How to Independently run positional and continuous servos using millis()?
I am setting up 3 servos (2 position servos and 1 '360' continuous rotational servo) with Arduino. but I failed to run these independently. It runs one after another. I wish to run it in loop ...
3
votes
2
answers
2k
views
Is there a need to put a delay in the main loop
Im a complete beginner. Generally speaking, is there any need at all to have a delay in the main loop()? Im not used to writing infinite loops π
Is it correct to say that the delay() command is ...
5
votes
1
answer
4k
views
What does a delay(0) actually do?
I've seen some code where the developers add delay(0), it doesnt make sense, what does it do? Delay with zero milliseconds, why?
bool DFRobotDFPlayerMini::waitAvailable(unsigned long duration){
...