Go Down

Topic: Serial monitor for 2 DC motors (Read 381 times) previous topic - next topic

RooDonald

Hi everyone,

I am working on a project that is using 2 dc motors with encoders (running one after the other). I have a working code that is controlled by which key on the keyboard I press. For both motors I have made a command so that when a set key is pressed the motor will go back to a count of 0 (start position) and when I test this using just one motor I can see it working with the serial monitor counting the encoder. Is it possible to count for both motors in the same code? So when the first motor has run its course and has been made to go back to a count of 0, I can then control the next motor in the same monitor window and it will then count for that motor. Sorry if I have explained this poorly. Any help is much appreciated, I still very new to arduino so I may be missing something obvious.
Thanks

Robin2

Is it possible to count for both motors in the same code?
Yes.

If you want more help post the program that represents your best attempt at working with the two motors.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

RooDonald

Thanks Robin. I managed to work it out. Thanks for replying though

Go Up