
154 Make: Robotic Arms
neutral starting location. As we progress through developing our code, it will
be our goal to use the rotary encoder to increase or decrease the value of our
position variables based on the rotation of the rotary encoder.
Next in the void setup, we need to attach our servo variables to the same pins
we’ve used previously so this latest version of our code matches the wiring
we’ve already established for our robotic arm.
Inside the void loop, our code looks very similar to before. We’re still using our
two if statements to compare the status of our two rotary-encoder variables,
CLK and DT. But now, instead of simply increasing ...