         else if (c == divider) {  // End of String
             switch (mode) {
                 case SERVO: steering = data.toInt();
-                case MOTOR: velocity = data.toInt();
+                case MOTOR: velocity = data.toInt();  // TODO: verify that negative values are parsed correctly (for reverse)
             }
             return;
         } else {

#define SERVO_40_DEG_L      850
#define SERVO_40_DEG_R      2150

#define MOTOR_NEUTRAL       1520 // TODO: verify value, may vary depending on ESC calibration
#define MOTOR_BRAKE_MAX     650
#define MOTOR_THROTTLE_MAX  2000

#define SERVO 0
#define MOTOR 1

}

void updateMotor() {
    /* map [-100,...,100] to [MOTOR_REVERSE_MAX,...,MOTOR_NEUTRAL] if reverse, [MOTOR_NEUTRAL,...,MOTOR_FORWARD_MAX] if forward */
    int val = 0;
    if (velocity == 0) {
        val = MOTOR_NEUTRAL; // move to center position (lower than center should brake)
    } else if (velocity < MOTOR_NEUTRAL) {
      val = map(velocity, -100, 0, MOTOR_REVERSE_MAX, MOTOR_NEUTRAL); // reverse
    } else {
      val = map(velocity, 0, 100, MOTOR_NEUTRAL, MOTOR_FORWARD_MAX); // forward
    }

    motor.writeMicroseconds(val);
}
