         //------------------------------------------
         case 'm': {
             out.print(F("\t motor moveTo "));
-            uint32_t position = atoi(&command[1]);
-            // mosys::motor.moveTo(position);
+            int32_t position = atoi(&command[1]);
+            myStepperMotor.moveTo(position);
             out.print(position);
             out.println();
         } break;
         case 'M': {
             out.print(F("\t motor get target:"));
-            // uint32_t position = mosys::motor.getTarget();
-            // if(position == mosys::motor.forwardLimit){
-            //     out.print(F("forwardLimit"));
-            // } else {
-            //     if(position == mosys::motor.reverseLimit){
-            //         out.print(F("reverseLimit"));
-            //     } else {
-            //         out.print(position);
-            //     }
-            // }
+            int32_t position = myStepperMotor.getTarget();
+            if(position == myStepperMotor.forwardLimit){
+                out.print(F("forwardLimit"));
+            } else {
+                if(position == myStepperMotor.reverseLimit){
+                    out.print(F("reverseLimit"));
+                } else {
+                    out.print(position);
+                }
+            }
             out.println();
         } break;
         case 'p': {
             out.print(F("\t motor set position "));
-            uint32_t position = atoi(&command[1]);
-            // mosys::motor.setPos(position);
+            int32_t position = atoi(&command[1]);
+            myStepperMotor.setPos(position);
             out.print(position);
             out.println();
         } break;
         case 'P': {
             out.print(F("\t motor position: "));
-            uint32_t position;
-            // position = mosys::motor.getPos();
+            int32_t position;
+            position = myStepperMotor.getPos();
             out.print(position);
             out.println();
         } break;
         case 'l': {
             out.print(F("\t motor set limits:"));
             out.println();
-            // uint16_t distLimit = // mosys::motor.fullStepVal * 200
-            // // mosys::motor.forwardLimit = distLimit;
-            // // mosys::motor.reverseLimit = -distLimit;
+            // uint16_t distLimit = myStepperMotor.fullStepVal * 200;
+            // myStepperMotor.forwardLimit = distLimit;
+            // myStepperMotor.reverseLimit = -distLimit;
             // get first limit
             int32_t limit_forward = atol(&command[1]);
-            // mosys::motor.forwardLimit = limit_forward;
+            myStepperMotor.forwardLimit = limit_forward;
             // defaults to negative of limit_forward
             int32_t limit_reverse = limit_forward * -1;
 

                out.print(F("\t   --> no second parameter given. used negative first."));
                out.println();
            }
            // mosys::motor.reverseLimit = limit_reverse;

            // print current/new limits
            out.print(F("\t   forwardLimit: "));
            // out.print(mosys::motor.forwardLimit);
            out.println();
            out.print(F("\t   reverseLimit: "));
            // out.print(mosys::motor.reverseLimit);
            out.println();
        } break;
        case 'L': {
            out.print(F("\t motor limits: "));
            out.println();
            out.print(F("\t   forwardLimit: "));
            // out.print(mosys::motor.forwardLimit);
            out.println();
            out.print(F("\t   reverseLimit: "));
            // out.print(mosys::motor.reverseLimit);
            out.println();
        } break;
        //------------------------------------------
        case 'D': {
            out.print(F("\t motor stop "));
            // mosys::motor.stop();
            out.println();
        } break;
        case 'd': {
            out.print(F("\t motor decelerate "));
            // mosys::motor.decelerate();
            out.println();
        } break;
        case 'r': {
            out.print(F("\t motor run forward "));
            // mosys::motor.moveTo(mosys::motor.forwardLimit);
            out.println();
        } break;
        case 'R': {
            out.print(F("\t motor run reverse "));
            // mosys::motor.moveTo(mosys::motor.reverseLimit);
            out.println();
        } break;
        //---------------------------------------------------------------------

            bool flag_value_valid = false;
            switch (mode) {
                case 1: {
                    myStepperMotor.setDriveMode(FULL_STEP);
                    flag_value_valid = true;
                } break;
                case 2: {
                    myStepperMotor.setDriveMode(HALF_STEP);
                    flag_value_valid = true;
                } break;
                case 4: {
                    myStepperMotor.setDriveMode(MICROSTEP_4);
                    flag_value_valid = true;
                } break;
                case 8: {
                    myStepperMotor.setDriveMode(MICROSTEP_8);
                    flag_value_valid = true;
                } break;
                case 16: {
                    myStepperMotor.setDriveMode(MICROSTEP_16);
                    flag_value_valid = true;
                } break;
                case 32: {
                    myStepperMotor.setDriveMode(MICROSTEP_32);
                    flag_value_valid = true;
                } break;
                case 64: {
                    myStepperMotor.setDriveMode(MICROSTEP_64);
                    flag_value_valid = true;
                } break;
                case 128: {
                    myStepperMotor.setDriveMode(MICROSTEP_128);
                    flag_value_valid = true;
                } break;
                default: {
