Trouble coding for an obstacle avoiding robot

The most likely answer is that the Adafruit_MotorShield library is not properly installed. How did you install the library? Through the IDE library manager?