arduino due control ai motor's

親愛的朋友們
我對因任務處理的I / O
下面是我的程序

INT LED = 13; 詮釋身份證; //馬達的ID INT托格; //轉距(0:MAX,4:分)INT校驗; //通訊協定INT TMP1,TMP2; //字節數量設置無效(){pinMode(LED,輸出); Serial.begin(115200); //起始串列115200,而(串行!){//等待通訊; }的id = 0; 托格= 4; //轉距速度digitalWrite(LED,高); TMP1 =(托格<< 5)| ID; //馬達速度及編碼號TMP2 = 60; //位置碼校驗=(^ TMP1 TMP2)到0x7f; //結束碼(馬達速度及編碼號的XOR位置碼)Serial.write(為0xFF); //回傳編碼Serial.write(TMP1); Serial.write(TMP2); Serial.write(校驗); 延遲(5000); //等待時間}無效循環(){digitalWrite(LED,高); TMP1 =(托格<< 5)| ID; //馬達速度及編碼號TMP2 = 100; //位置碼校驗=(^ TMP1 TMP2)到0x7f; //結束碼(馬達速度及編碼號的XOR位置碼)Serial.write(為0xFF); //回傳編碼Serial.write(TMP1); Serial.write(TMP2); Serial.write(校驗); 延遲(1000); //等待時間digitalWrite(LED,低); TMP1 =(托格<< 5)| ID; TMP2 = 200; 校驗和=(^ TMP1 TMP2)到0x7f; Serial.write(為0xFF); Serial.write(TMP1); Serial.write(TMP2); Serial.write(校驗); 延遲(1000); digitalWrite(LED,高); TMP1 =(托格<< 5)| ID; TMP2 = 180; 校驗和=(^ TMP1 TMP2)到0x7f; Serial.write(為0xFF); Serial.write(TMP1); Serial.write(TMP2); Serial.write(校驗); 延遲(1000); digitalWrite(LED,低); TMP1 =(托格<< 5)| ID; TMP2 = 220; 校驗和=(^ TMP1 TMP2)到0x7f; Serial.write(為0xFF); Serial.write(TMP1); Serial.write(TMP2); Serial.write(校驗); 延遲(1000); }

艾電機內部有4個引腳(G,TX,RX,V)
電機TX - >到期RX0
電機接收 - >到期TX0
it’can控制的AI馬達,但不能同時控制另一個
如何做修改我的程序使用中由於TX1,RX1,TX2,RX2,RX3,TX3銷
我有控制4 AI馬達 :’(