 
     switch (phase) {
         case RAMP_UP: {
-            int power = FULL_SPEED * countSincePhase / RAMP_LENGTH;
-            if (power > FULL_SPEED)
-                power = FULL_SPEED;
+            int power = roofSpeed * countSincePhase / RAMP_LENGTH;
+            if (power > roofSpeed)
+                power = roofSpeed;
             motorShield.setM1Speed(power * direction);
-            if (power == FULL_SPEED)
+            if (power == roofSpeed)
                 phase = MOVE_UNTIL_NEAR;
             break;
         }
         case RAMP_DOWN: {
-            int power = FULL_SPEED - FULL_SPEED * countSincePhase / RAMP_LENGTH;
+            int power = roofSpeed - roofSpeed * countSincePhase / RAMP_LENGTH;
             int minimumPower = (roofState == CLOSING ? CLOSING_SPEED : 0);
             if (power < minimumPower)
                 power = minimumPower;

        roofState = STOPPING;
        phase = RAMP_DOWN;
        // start mid-ramp if we were not running at full speed
        countSincePhase = RAMP_LENGTH - RAMP_LENGTH * motorShield.getM1Speed() / FULL_SPEED;
    }
    if (roofState == ERROR) {
        roofState = STOPPED;

    }
    serial.print(message);
}

void setspeed(const String& speedAsString) {
    roofSpeed = atoi(speedAsString.c_str());
    serial.print("SETSPEED,OK");
}
