新型モータードライバのメインプログラム

Dependencies:   mbed

Revision:
2:c77482250d0b
Parent:
1:e45830806a1c
Child:
3:65eaf88bf278
--- a/main.cpp	Sat May 14 05:58:39 2016 +0000
+++ b/main.cpp	Sat May 14 12:23:29 2016 +0000
@@ -9,8 +9,14 @@
 //モータードライバの動作モード
 #define ORDER_FOLLOWING_MODE    0
 #define ENCODER_FOLLOWING_MODE  1
-#define SINGLE_ORDER_MODE       2
-#define SEND_POWER_MODE         3
+#define SINGLE_ORDER_MODE       2 //単命令を受信した後は必ずsendback
+
+//単命令動作の種類
+#define S_ORDER_FREQUENCY           0
+#define S_ORDER_SEND_POWER          1
+#define S_ORDER_LINEAR_AUTOCHANGE   2
+#define S_ORDER_CERTAIN             3
+#define S_ORDER_SEND_ENCODER        4
 
 #define F_MD 18000 //PWMキャリア周波数設定
 
@@ -45,7 +51,14 @@
 uint8_t sendPowerFlag = 0;
 
 void orderFollowManager(uint8_t reciveData, uint8_t dataNumber){
-    
+    switch (dataNumber) {
+        case 2:
+            break;
+        case 3:
+            break;
+        case 4:
+            break;
+    }
 }
 
 void encoderFollowManager(uint8_t reciveData, uint8_t dataNumber){
@@ -56,10 +69,6 @@
     
 }
 
-void sendPowerManager(uint8_t reciveData, uint8_t dataNumber){
-    
-}
-
 void com_rx() {
     static uint8_t reciveData;
     reciveData = comPort.getc();
@@ -86,9 +95,6 @@
                 case SINGLE_ORDER_MODE:
                     S_orderFollowManager(reciveData, dataNumber);
                     break;
-                case SEND_POWER_MODE:
-                    sendPowerManager(reciveData, dataNumber);
-                    break;
             }
         }    
     }