ライブラリ化を行った後

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_Practice1 by kusano kiyoshige

Revision:
49:b041c815c063
Parent:
48:96b5f5ebdfb0
Child:
50:e4e1f38d1bd5
--- a/main.cpp	Wed Sep 13 00:19:44 2017 +0000
+++ b/main.cpp	Wed Sep 13 01:25:07 2017 +0000
@@ -148,7 +148,7 @@
     sbdbt.begin(sbdbt_baud);
     rs422.begin(rs422_baud);
     cylinder_origin_first();
-    cylinder_pos_num = 1;                   //セットアップタイムでの初期装填のため
+    cylinder_pos_num = 2;                   //セットアップタイムでの初期装填のため
     output_timer.attach(&output, output_period);
     yaw_pid.setup(yaw_Kp, yaw_Ki, yaw_Kd);
     mecanum.setupdeg(bno055.getYawRad());   //基盤が前後逆の場合+180
@@ -303,11 +303,9 @@
     //led1 = sbdbt.get_pairingState();
     sbdbt_indigator = sbdbt.get_pairingState();
 
-    if(sbdbt.up) {
-        cylinder_origin_flag = 1;
-    }
-
-    cylinder_reload.cyclic(sbdbt.left);
+    if(sbdbt.up)cylinder_origin_flag = 1;
+    if(sbdbt.left)bno055.yaw_origin();
+    cylinder_reload.cyclic(sbdbt.down);
 
     static int counter;
     int id[nucleo_num] = {n1_id, n2_id, n3_id, n4_id, n5_id, n6_id};
@@ -325,7 +323,7 @@
                 counter ++;
                 break;
             case 2:
-                rs422.put(id[counter], enc_cylinder.duty()*-1, 0.0);
+                rs422.put(id[counter], -1*enc_cylinder.duty_enableWidth(-.0,5.0), 0.0);
                 counter ++;
                 break;
             case 3: