Control code for the pendulum drawing mechanism.