Main Program

Dependencies:   mbed AQM1602 HMC6352 PID

Revision:
34:69bdf29a4442
Parent:
31:0b0f64831771
Child:
37:ae5661306900
--- a/main_processing/setup_command_active/setup.cpp	Tue Feb 02 04:21:09 2016 +0000
+++ b/main_processing/setup_command_active/setup.cpp	Tue Feb 02 10:31:05 2016 +0000
@@ -4,7 +4,8 @@
 
 void SetUp(void){//電源を入れた時の処理
     //int i=1;
-    
+    //solenoid
+    kicker=0;
     //sw&lcd
     Sw[0].mode(PullUp);
     Sw[1].mode(PullUp);
@@ -22,8 +23,8 @@
     data.strategy = 0;
     data.motorlog[X_AXIS] = 0;
     data.motorlog[Y_AXIS] = 0;
-    data.s_pow=20;
-    data.l_pow=20;
+    data.s_pow=30;
+    data.l_pow=30;
     
     //spi
     spi.format(16, 3);
@@ -51,9 +52,16 @@
     //pidupdate.attach(&PidUpdate, PID_CYCLE);
 }
 void SetUp2(void){//スタートした時の処理
-    
+    data.KickOffFlag=1;
+    data.KickFlag=0;
+    //solenoid
+    kicker=0;
     data.motorlog[X_AXIS] = 0;
     data.motorlog[Y_AXIS] = 0;
+    /*data.LineBind[0]=0;
+    data.LineBind[1]=0;
+    data.LineBind[2]=0;
+    data.LineBind[3]=0;*/
     for(int i=0; i<5; i++){
         ReadCmps();
         data.CmpsInitialValue = data.cmps;
@@ -63,7 +71,7 @@
     data.FrontDeg=0;
     
     Line_ticker.attach(&ReadLine, 0.005);
-    Solenoid_ticker.attach(&AvailableSolenoid, 6.0);
+    //Solenoid_ticker.attach(&AvailableSolenoid, 3.0);
     Ir_ticker.attach(&ValidIr, 0.050);
     //motor.attach(&tx_motor,Serial::TxIrq);          //送信空き割り込み(モータ用)
     Motor_ticker.attach(&ValidTx_motor, 0.020);
@@ -80,4 +88,6 @@
     move(0,0,0);
     data.OutputPID=0;
     data.InputPID=REFERENCE;
+    //solenoid
+    kicker=0;
 }