The code does not seem to run when the motor is plugged in, but when the motor is unplugged, the code runs just fine.
We uploaded the code to the Quirkbot and the parts of the program not related to the servo motor works correctly (LEDs are giving expected output). When we then plug in the motor, the LEDs stop blinking and the loading indicator (LED mouth) turns on. Apart from the green loading indicator light and the orange charging indicator, the quirkbot is now giving no output. Unplugging the motor resets the Quirkbot to the default program.
Uploading the code with the motor plugged in causes the upload to fail and Chrome to no longer detect the Quirkbot (until the motor is unplugged).