I am trying to implement simple stepper motors controller where two mottors will be responsible for moving intro two directions independently. Here is the idea:
I would like to spawn two threads, first for motor controlling x axis and second for controlling y axis. Then I would like to iterate over 'moves' array, and for each 'move' execute code moving each motor on separate threads. And when they are done proceed with next 'move' element. I have just read about mutexes (they seem to fit here) but I cant figure out how to properly implement that in rust. Can you please help me with some basic example or at least general idea of doing that? Regards
As your data comes in x/y pairs, you definitely do not want to split that up.
It should be absolutely no problem to run many motors in a single thread.