I'm trying to run several motors and servos, connected to the arduino via an h-bridge, using a joystick connected to a PC and sending serial data to the arduino. I've got the arduino receiving the joystick data, but as I need one byte for each motor direction, I've ended up using the arduino to write 8 bytes of data to 8 PWM pins. I've noticed an appreciable delay in the arduino's response time and have had to add several slow-downs in the programming at both ends in order to reduce mixed signals, and yet I'm still getting a lot of improper pin firing. Is this reaching the limit of the arduino's processing power or am I simply doing something wrong?
Do you have a mega, a standard Arduino only has 6 PWM pins. Perhaps if you say exactly what you have connected up it would be easier to advise
Could you say a bit more about the serial protocol? There may be problems there with the time taken to send/receive, but it all depends on how the protocol is designed.
Decoherence and I are working on the same robot, though he is loads better at programming. I can't tell you any more about the serial problems, but I can verify, mem, that we are using a Mega.
have had to add several slow-downs in the programming at both ends in order to reduce mixed signals
and then you say:-
I've noticed an appreciable delay in the arduino's response time
The two are related.
am I simply doing something wrong
Almost certainly yes. Try an think about your overall code structure and a better way of distinguishing your two sets of data, like unique header bytes. Programming in delays is only ever a compromise.