I don't know if it's the standard way but this is a way I developed multitasking.
never use the function delay(); and if you need timing function for accelerations and stuff like that just use timers (I Use "long" variable for that) along with the function millis() and if statements to check if at the current interval you have reached that time. also I use some flags for some processes and store them in variables.
Just say if you wanna learn about it more in depth but arduino has a good example about basic multi tasking using the example "delay without blink" of course it's not as accurate as using the delay function but it is essential sometimes and this processor is so fast you can't tell the difference.
If you implement your functions using state machines and no delays, you can call one state machines and then the next (alternating) and you will have a useful form of multitasking.
Also be aware that the atmega chip has peripherals which can be set running and left (the PWM outputs are a good example)
If you implement your functions using state machines and no delays, you can call one state machines and then the next (alternating) and you will have a useful form of multitasking.
Also be aware that the atmega chip has peripherals which can be set running and left (the PWM outputs are a good example)
If you want to get help, you must provide details. What do you want to output to the speaker? A simple square wave sound or an mp3 file? What kind of servo motor are you talking about? A regular R/C servo or something else? What have you done until now and at which point do you have problems?
And finally, do you read the replies to your post?