I2C slave protocol

Thanks for your interest.

I am under the impression that I am do all that.
It is a simple master / slave setup not a mulimaster setup like you put.

This is what happens in the slave
The receiveRequest function takes in the required slider positions and sets a flag. In the loop function this flag is tested and if set a move slider function is called and when it returns the flag is cleared.

The requestData function reports back the position of the sliders as two bytes, substituting two bytes of 0xff if the motor moving flag is set.

By the way:-

-1 is required to be defined in terms of a numerical value.

Not sure what that means but to a hardware man two bytes of 0xff is the two's complement of 1 and hence -1, by not clearing the moving flag in the move sliders function I always receive -1 from any request for the sliders position, so that bit works.

It looks to me like the function that switches on the motors and regulates the speed and monitors the position, is not being interrupted and running the requestData until after that function is finished.

This is what I see, and this is not what I thought happens. From the replies here, I think that is what everyone else imagens happens.