I got super lost

My camera will be attached to my canon and it will spin with a motor. So instead of attaching a servo to move in the X axis I want it to move the whole thing...The motor will move the canon and therefore the camera
And I wanted to know if I can edit that code with that and know that it will work...
For the drive...I have a 4WD Arcade drive
