Timeline for Regarding running multiple functions using millis
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 13, 2018 at 16:29 | comment | added | Edgar Bonet |
@RajeshAnand10: 1. Learning about object-oriented programming (classes with constructors and methods) is useful, but you can live without it for simple projects like this. 2. delay() was useful in your previous version only because you got the logic wrong. Once you properly detect state changes, it serves no useful purpose. 3. What do you mean by "overkill"? Do you believe millis() is more heavyweight than delay() ? It's not. For your particular problem, it's the right tool for the job.
|
|
Dec 13, 2018 at 16:18 | comment | added | Edgar Bonet | @Jot: Good idea. I added the link. | |
Dec 13, 2018 at 16:18 | history | edited | Edgar Bonet | CC BY-SA 4.0 |
Link to state-change-detection example, as suggested by Jot.
|
Dec 13, 2018 at 15:28 | comment | added | Rajesh Anand10 | This code looks neat and will definitely try with this one. I don't know much about constructors and structure things. Will learn about that. I used a delay in my program so as not to have too many data points and instead the data once in two or three seconds will be enough plus its not a time critical application, so I don't know if using millis function is overkill for my application. Thank you though :) | |
Dec 13, 2018 at 13:00 | comment | added | Jot | What about a link to the state-change-detection example? arduino.cc/en/Tutorial/StateChangeDetection | |
Dec 13, 2018 at 12:19 | history | answered | Edgar Bonet | CC BY-SA 4.0 |