Interpreting sensor input for robot.

OK, I'll clean up the rest of the code and I'll start testing tomorrow. I'll get back to you with the results.