This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Running 2 Routines at the same time

Hey Guys,

I am curious to know how to run two routines at the same time. for example, I have Stepper_Motor1(); and Stepper_Motor2(); routines, I want both to run at the same time. What I know is only running it sequence, which means run Stepper_Motor1(); first, then after completed, run Stepper_Motor2();. I don't want it to be in a sequence. I want it to run both at the same time.

Thanks For Your Kind Help!

Parents
  • There is always the possibility of using an RTOS with individual tasks.

    But the normal way of doing this is actually to have the main loop compute what the stepper motors are expected to do, and actually control the motors from individual interrupt handlers.

    So you select a processor that has the required hardware support for handling multiple stepper motors and then write all code around this hardware functionality.

Reply
  • There is always the possibility of using an RTOS with individual tasks.

    But the normal way of doing this is actually to have the main loop compute what the stepper motors are expected to do, and actually control the motors from individual interrupt handlers.

    So you select a processor that has the required hardware support for handling multiple stepper motors and then write all code around this hardware functionality.

Children