ライブラリ化を行った後

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:
30:57061e222f10
Parent:
29:f380201ca30f
Child:
31:285c9898da03
diff -r f380201ca30f -r 57061e222f10 main.cpp
--- a/main.cpp	Thu Aug 24 17:53:57 2017 +0000
+++ b/main.cpp	Thu Aug 24 18:20:12 2017 +0000
@@ -79,9 +79,9 @@
 void boost();
 void cylinder_origin();
 void sword_cal();
+int reload_magazine_flag;
 float yaw, target_yaw;
 
-
 int main()
 {
     setup();
@@ -163,19 +163,20 @@
 
 //追記(動作未確認)
 void cylinder_cal()
-{
+{   
     cylinder.cyclic(sbdbt.shikaku);
     enc_cylinder.deg_cylinder_cal();
 
-    if(cylinder.getInState() && interrupt){
-        if(interrupt_reload == 0){
-            rs422.put(n6_id, 0.8, 0.0);
-        }else{
-            servo_reload =+ 0.05;
-            if(servo_reload >= 1.0)servo_reload = 1.0;
-        }
+    if(cylinder.getInState() == 1){
+        if(interrupt)servo_reload = 1.0;
     }else{
         servo_reload = 0.0;
+        reload_magazine_flag = 1;
+    }
+    
+    if(reload_magazine_flag == 1){
+        rs422.put(n6_id, 0.8, 0.0);
+        if(interrupt_reload == 1)reload_magazine_flag = 0;
     }
 }