Hi at all,
for a personal project I'm trying to move a stepper motor (with a dedicated stepper board) from an atmega 328p, with I2c bus another arduino will pass at the atmega all the parameters of the stepper.
I need to pass through I2c the speed of the stepper (0-4000 value), the acceleration (0-4000 value) and the targhet_position (-10000 - +1000 value).
The only method that I found to do that is to separate my numbers and build a bit data array and rebuild my number with a dedicated code in the 328.
So my question is: is there some more efficent ways to move those data? I may rest in I2c or better move to another transmission protocol?
The targhet for me is to say on the master: (pseudo code)
Stepper1(328_number, pin, pin); /* With Easy driver I need only Step pin and Dir pin, and stepper attach to atmega 328_number */
And a part of code will automatically redirect the information on the right atmega to the right stepper, so first define the engine not attach directly but on the right atmega.
I hope to be as clear as possible.
Thanks in advance! Riccardo