We present a time and energy optimal controller for a two-wheeled differentially driven robot. We call a mission the task of bringing the robot from an initial state to a desired final state (a state is the aggregate vector of the position and velocity vectors). The proposed controller is time optimal in the sense that it can determine the minimum amount of time required to perform a mission. The controller is energy optimal in the sense that given a time constraint of n seconds, the controller can determine what is the most energy efficient sequence of accelerations to complete the mission in n seconds.