sampleProgram

Dependencies:   QEI accelerator bit_test cyclic_io cyclic_var cylinder event_var limit mbed mecanum motor_drive pid pid_encoder rs422_put sbdbt servo

Fork of 17robo_fuzi by kusano kiyoshige

Revision:
23:aeff5fd36ae1
Parent:
21:6568c3587003
Child:
24:da0fc94add43
diff -r 6568c3587003 -r aeff5fd36ae1 main.cpp
--- a/main.cpp	Sat Aug 05 00:44:10 2017 +0000
+++ b/main.cpp	Sat Aug 05 04:23:30 2017 +0000
@@ -23,7 +23,7 @@
 #define rs422_rx    p27
 #define rs422_baud  115200
 #define output_period   0.015
-#define nucleo_num  4
+#define nucleo_num  5
 #define pi          3.141592
 #define n1_id       3
 #define n2_id       4
@@ -118,7 +118,7 @@
     //boost();
 
     static int counter;
-    int id[nucleo_num] = {n1_id, n2_id, n3_id, n4_id};
+    int id[nucleo_num] = {n1_id, n2_id, n3_id, n4_id, n5_id};
 
     switch (counter) {
         case 0:
@@ -134,11 +134,11 @@
             counter ++;
             break;
         case 3:
-            rs422.put(id[counter], (sbdbt.sankaku*0.5-sbdbt.batu*0.5), ((float)sword_right.getState()));
+            rs422.put(id[counter], (sbdbt.sankaku*0.5-sbdbt.batu*0.5), (sbdbt.up*0.5-sbdbt.down*0.5) );
             counter ++;
             break;
         case 4:
-            rs422.put(id[counter], (sbdbt.up*0.5-sbdbt.down*0.5), ((float)sword_left.getState()));
+            rs422.put(id[counter], ((float)sword_left.getState()),0.0);
             counter = 0;
             break;
         default: