C code for the robot