2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Committer:
DeguNaoto
Date:
Sat Sep 26 00:52:38 2015 +0000
Revision:
48:64d005c70df2
Parent:
47:46db7f076cea
Child:
49:9276fda93084
????PID???????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DeguNaoto 22:3996c3f41922 1 #ifndef MANUALMODE_H
DeguNaoto 22:3996c3f41922 2 #define MANUALMODE_H
DeguNaoto 22:3996c3f41922 3
DeguNaoto 31:74e77ef0831c 4 void manualMovePs3()
DeguNaoto 31:74e77ef0831c 5 {
DeguNaoto 44:315d5960f18c 6 if(analog_ly>10) {
DeguNaoto 31:74e77ef0831c 7 Move_l(-0.4);
DeguNaoto 31:74e77ef0831c 8 Move_r(0.4);
DeguNaoto 44:315d5960f18c 9 } else if(analog_ly<-10) {
DeguNaoto 31:74e77ef0831c 10 Move_l(0.4);
DeguNaoto 31:74e77ef0831c 11 Move_r(-0.4);
DeguNaoto 31:74e77ef0831c 12 } else {
DeguNaoto 44:315d5960f18c 13 if(analog_lx>10) {
DeguNaoto 47:46db7f076cea 14 Move_l(0.4);
DeguNaoto 47:46db7f076cea 15 Move_r(0.4);
DeguNaoto 47:46db7f076cea 16 } else if(analog_lx<-10) {
DeguNaoto 31:74e77ef0831c 17 Move_l(-0.4);
DeguNaoto 34:f9ef622f4376 18 Move_r(-0.4);
DeguNaoto 31:74e77ef0831c 19 } else {
DeguNaoto 24:271da6144a02 20 Move_l(0.0);
DeguNaoto 24:271da6144a02 21 Move_r(0.0);
DeguNaoto 24:271da6144a02 22 }
DeguNaoto 23:5c56747bcc43 23 }
DeguNaoto 23:5c56747bcc43 24 }
DeguNaoto 22:3996c3f41922 25
DeguNaoto 31:74e77ef0831c 26 void manualPs3()
DeguNaoto 31:74e77ef0831c 27 {
DeguNaoto 31:74e77ef0831c 28 if(circle) {
DeguNaoto 35:2db63dec2a67 29 if(edge_circle) edge_circle=0,autoflag=1,Indicator4=1,IndicatorAuto=0;
DeguNaoto 48:64d005c70df2 30 }
DeguNaoto 48:64d005c70df2 31 else if(triangle) targSwingRadVelocity = swingspeed;
DeguNaoto 31:74e77ef0831c 32 else if(square) {
DeguNaoto 31:74e77ef0831c 33 if(edge_square) {
DeguNaoto 46:30776358bd42 34 edge_square=0;
DeguNaoto 48:64d005c70df2 35 sendData(1,6);
DeguNaoto 29:03bb1ddbe456 36 }
DeguNaoto 48:64d005c70df2 37 }
DeguNaoto 48:64d005c70df2 38 else if(cross) targSwingRadVelocity = 0.0;
DeguNaoto 29:03bb1ddbe456 39 else if(r1) sendData(1,4);
DeguNaoto 29:03bb1ddbe456 40 else if(l1) sendData(1,5);
DeguNaoto 29:03bb1ddbe456 41 }
DeguNaoto 29:03bb1ddbe456 42
DeguNaoto 22:3996c3f41922 43
DeguNaoto 22:3996c3f41922 44
DeguNaoto 22:3996c3f41922 45 #endif /*manualMode.h*/