c code for controlling the claw