DC motor control with switches

As bubulindo observes, your while loops are causing you issues, as written, your program will only read the buttons once. Assuming you weren't pressing the InspectionStop button when the program started, it will spin in the first loop, doing nothing, forever.

A more effective approach would be to build a state machine: you only need a few states - start, cw, stop, ccw, end inspection. Read the buttons at the start of loop & then use a switch statement based on current state to see if the buttons indicate a need for state change. If they do, set your outputs appropriately and change state. Then loop will be called repeatedly, rather than once as you have it. There are plenty of examples of this posted in the forums - I gave one in this thread: What have I done right/wrong? - #9 by wildbill - Programming Questions - Arduino Forum