I want a simple stepper driven robot device to push buttons (cross configuration) on a hand controller, controlling two perpendicular axis. Thinking 2D, turning right and moving forward only.
An arm attached to the stepper shaft sweeps over the pushbuttons activating them. To move forward two steps the arm sweeps left then right and vice versa. To turn right, the arm sweeps over two adjacent buttons, going clockwise.
The sequence to do this is as follows - where -1 == left sweep and 1 == right sweep. 2 == right and right again. The arm travels 90deg with each sweep.
Each sequence is repeated before being incremented and actioned twice - and so on in the following pattern - a box spiral.
2, -1, 2, -1, 2, -1, 1, -1, 2, -1, 1, -1, 2, -1, 1, -1, 1, -1, 2, -1,1,-1,1,-1, 2,...
I am baffled as to how to express this to run as a for or while statement or other expression.
Why am I doing this? Besides moving an imaging sensor between shots to increase signal to noise ratio in the finished image, the instrument is practically a collectors item. It has a +ve earth! And I don't want to affect it cosmetically.
A bit left field, but thanks for looking.