Got an Arduno Uno, with a pixy cam and 4 motors. I need to control 4 motors independent by PWM, in such a way that i can sent for example
Motor 1; 4000 pulses (2000Hz pulses) Motor 2; 2000 pulses ( 200Hz pulses) Motor 3; till some sensor reacts (motor requires a 2000Hz signal Motor 4; till some sensor reacts (motor requires a 200hz signal)
The problem i face with this is, that these motors need to be enabled add a random time. So often one of the motors is allready running then i need for example motor 1 to do 4000 pulses.
I was thinking of using the Tone command for this, ea tone(pin, frequency, duration) However that works for one pin at a time.
But this must be possible i believe since reprap printers can control 2 motors too to xontrol x y of the printing head. So what is the trick behind it ?.