Skip to main content
Arduino

Timeline for How to run multiple functions one after another?

Current License: CC BY-SA 3.0

19 events
when toggle format what by license comment
Jun 6, 2019 at 22:56 vote accept R1S8K
S Nov 9, 2016 at 15:31 history suggested sa_leinad CC BY-SA 3.0
Clarified the question based on the OPs comments in the answers.
Nov 9, 2016 at 15:19 review Suggested edits
S Nov 9, 2016 at 15:31
Nov 7, 2016 at 11:50 vote accept R1S8K
Jun 6, 2019 at 22:56
Nov 5, 2016 at 13:09 answer added R1S8K timeline score: 0
Nov 5, 2016 at 7:47 history edited jfpoilpret CC BY-SA 3.0
added 268 characters in body
Nov 5, 2016 at 7:11 answer added Nick Gammon timeline score: 4
Nov 5, 2016 at 6:37 comment added R1S8K @Nick Gammon Why my loops are very complicated? I'm trying to do as much simple code as I can with true C. If you have any suggestions for improving my code tell me, I would like to learn new techniques :)
Nov 5, 2016 at 6:35 comment added R1S8K @Edgar Bonet Yes, I know it's not intel multithreaded processor. I know it does 1 fetch and 1 execute every cycle. Of course there's no parallelism in processing. The Atmega 328p actually runs them simultaneously which updates each function so fast. It doesn't run one function and waits for it to finish.
Nov 4, 2016 at 22:41 comment added Nick Gammon Your very complicated loop function looks to me the same as: while (true) fade_red(1);
Nov 4, 2016 at 21:17 answer added Edgar Bonet timeline score: 4
Nov 4, 2016 at 20:40 comment added Edgar Bonet "they run at the same time". No, they don't. They run one after the other. You are misinterpreting the symptoms you see: the Arduino runs a single thread of execution, with no provisions for parallelism.
Nov 4, 2016 at 20:21 history edited R1S8K CC BY-SA 3.0
added 125 characters in body
Nov 4, 2016 at 19:04 answer added JRobert timeline score: 4
Nov 4, 2016 at 18:09 comment added R1S8K This was my first attempt which also gives the same result, they run at the same time. Which I don't want, I want to run one after the other.
Nov 4, 2016 at 18:06 review Close votes
Nov 14, 2016 at 3:05
Nov 4, 2016 at 18:03 comment added Edgar Bonet Write the function calls one after the other, each terminated with a semicolon, like: first_function(); second_function();
Nov 4, 2016 at 17:51 answer added Dat Han Bag timeline score: 2
Nov 4, 2016 at 17:21 history asked R1S8K CC BY-SA 3.0
toggle format

AltStyle によって変換されたページ (->オリジナル) /