                         writePos(arg, posZ);
                         break;
                     default:
-                        Serial.write("err unknown status\n");
+                        Serial.write("err unknown status ");
                         Serial.write(arg);
+                        Serial.write('\n');
                 }
                 break;
             case 'p': // ping

    int steps = Serial.parseInt();
    pos += steps;
    motor.rotateSteps(steps);
    Serial.write("OK.\n");
}

void writePos(char name, int var) {
    Serial.write("set pos.");
    Serial.write(name);
    Serial.write(' ');
    Serial.print(var);
    Serial.write('\n');
}

void loop() {

                        Serial.write("err unknown config\n");
                }
                break;
            case '?': // get config/status
                while (!Serial.available());
                switch (arg = Serial.read()) {
                    case '0': // check if reference point exists
