LV8548 Motor Driver Stepper Motor Dc MOtor

Dependencies:   LV8548 mbed

Revision:
2:77d8b59fa58c
Parent:
1:f62c3257d673
Child:
3:de46cb8b50cb
--- a/Main.cpp	Sat Nov 17 05:11:50 2018 +0000
+++ b/Main.cpp	Mon Nov 19 01:52:38 2018 +0000
@@ -8,11 +8,10 @@
 #define DEFAULT_BAUDRATE  (19200) 
 //#define DEFAULT_BAUDRATE  (115200) 
 
-#define USE_DC_MOTOR      (false)
-#define USE_STEP_MOTOR    (true)
+#define USE_DC_MOTOR      (false)            // true : dc motor  false: Stepper
 
 
-#define _USE_DEBUG_     (0)
+#define _USE_DEBUG_     (1)
 enum DCSerialCommandType {
     SRMES_GET_ID      = 0x03,        //  3
     SRMES_POLLING_ID  = 0x04,        //  4
@@ -252,7 +251,7 @@
 /***************************************************************************************************/
             case SRMES_CTL_VOLTAGE: // 0x41
             {
-                 DcMtrvoltValue = *(SrMesDivCtlVoltage *)SerialBuffer;
+                 DcMtrvoltValue = *(SrMesDivCtlVoltage *)&SerialBuffer[1];
 #if _USE_DEBUG_
                  uart.printf("Voltage Commnad %2x %2x \n",DcMtrvoltValue.motorNo,DcMtrvoltValue.duty);
 #endif