Main Program

Dependencies:   mbed AQM1602 HMC6352 PID

Revision:
19:342da3a5a474
Child:
21:d69a8f3c76e1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main_processing/setup_command_active/setup.cpp	Thu Jan 21 07:11:08 2016 +0000
@@ -0,0 +1,62 @@
+#include "mbed.h"
+#include "extern.h"
+
+
+void SetUp(void){//電源を入れた時の処理
+    //int i=1;
+    
+    //gyro
+    //Init();
+    
+    //sw&lcd
+    Sw[0].mode(PullUp);
+    Sw[1].mode(PullUp);
+    Sw[2].mode(PullUp);
+    Sw[3].mode(PullUp);
+    Sw_ticker.attach(Sw_sample, 0.02);
+    //Sw_ticker.attach(Sw_sample, 0.005);
+    //data.lcdpoint[0] = 0;
+    Lcd.cls();
+    Lcd.print(lcdstr[0][0]);
+    
+    //ball
+    BallChecker.mode(PullUp);
+    
+    //value
+    data.strategy = 3;
+    
+    //spi
+    //spi.format(16, 0);
+    //spi.frequency(5000000);
+    //spi_ss[0]=spi_ss[1]=spi_ss[2]=spi_ss[3]=1;
+    
+    //motor
+    //motor.baud(115200);                             //ボーレート設定
+    //motor.printf("1F0002F0003F0004F000\r\n");       //モータ停止
+    //motor.attach(&tx_motor,Serial::TxIrq);          //送信空き割り込み(モータ用)
+    
+    //bluetooth
+    //RN42.attach(&TX, Serial::TxIrq);//送信バッファ空き割込み
+    //RN42.attach(&RX, Serial::RxIrq);//受信割込み
+    //RN42.putc(i);//送信開始
+    //i = RN42.getc();//受信開始
+    
+    for(int i=0; i<5; i++){
+        //data.GyroInitialValue = ROUND(data.gyro);
+        //wait_ms(10);
+    }
+    //data.FrontDeg=0;
+    
+    //pid.setInputLimits(MINIMUM,MAXIMUM);            //pid sed def
+    //pid.setOutputLimits(-OUT_LIMIT, OUT_LIMIT);     //pid sed def
+    //pid.setBias(PID_BIAS);                          //pid sed def
+    //pid.setMode(AUTO_MODE);                         //pid sed def
+    //pid.setSetPoint(REFERENCE);                     //pid sed def
+    //pidupdate.attach(&PidUpdate, PID_CYCLE);
+}
+void SetUp2(void){//スタートした時の処理
+    data.strategy=0;
+}
+void StopProcess(void){//コマンドに戻るときの処理
+    
+}