Multitasking with arduino

Thread Starter

Etka Besim

Joined Jul 4, 2017
1
i wanna control Speaker and Servo motor together with arduino . How can i control these together ? i hope you help me :)
 

djsfantasi

Joined Apr 11, 2010
9,163
What are you doing with the servo?
The Arduino servo library will maintain its position until another position is sent.

Thus, you may have enough time to control the motor. And if commands to the motor, are you using the motor shield? The same comments apply. Once you command the motor, it will maintain the desired speed.

Your problem may be what to do with all the time you have.

You need a sketch which checks the appropriate conditions for a servo move and issue the servo command, and save the servo condition.

And then the same logic for the motor.

Simply loop, checking/modify the servo. Check/modify the motor. Loop.
 
Top