Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed AQM0802 CRotaryEncoder TB6612FNG_Ver1
Revision 16:d7444aa6afe7, committed 2019-11-25
- Comitter:
- 1817106
- Date:
- Mon Nov 25 10:23:01 2019 +0000
- Parent:
- 15:9e234fb2d07a
- Commit message:
- drone_unit;
Changed in this revision
| TB6612FNG.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/TB6612FNG.lib Fri Nov 08 06:38:09 2019 +0000 +++ b/TB6612FNG.lib Mon Nov 25 10:23:01 2019 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/Robotrace_shimane/code/TB6612FNG/#760a81881b3a +https://os.mbed.com/teams/Robotrace_shimane/code/TB6612FNG_Ver1/#6b323711c9bb
--- a/main.cpp Fri Nov 08 06:38:09 2019 +0000
+++ b/main.cpp Mon Nov 25 10:23:01 2019 +0000
@@ -48,15 +48,14 @@
//デジタル入力オブジェクト定義
DigitalIn push_sw(D13);
/////アナログ入力オブジェクト定義//////////
-AnalogIn s1(A1);
-AnalogIn s2(D3);
-AnalogIn s3(A6);
-AnalogIn s4(A5);
-AnalogIn s5(A4);
-AnalogIn s6(A3);
-AnalogIn s7(A2);
+AnalogIn s2(A6);
+AnalogIn s3(A5);
+AnalogIn s4(A4);
+AnalogIn s5(A3);
+AnalogIn s6(A2);
+AnalogIn s7(A1);
AnalogIn s8(A0);
-///////////////////////////////////////
+///////////////////////////////////////
Serial PC(USBTX,USBRX);
CRotaryEncoder encoder_a(D1,D0); //モータAのエンコーダ
CRotaryEncoder encoder_b(D11,D12); //モータBのエンコーダ
@@ -103,7 +102,7 @@
int SG_Cnt=0;
int Cross_Flag=0;
void sensor_analog_read(){
- S1_Data=s1.read();
+ S1_Data=0;
S2_Data=s2.read();
S3_Data=s3.read();
S4_Data=s4.read();
@@ -196,7 +195,7 @@
else if((SG_Flag==1)&&(SG_Cnt==0)){//ゴールスタートマーカの時⇒1回目
SG_Cnt=1;
}else if((SG_Flag==1)&&(SG_Cnt==1)){//ゴールスタートマーカの時⇒2回目
- Machine_Status|=STOP; //機体停止状態へ
+ //Machine_Status|=STOP; //機体停止状態へ
SG_Cnt=0;
}else if(Corner_Flag==1){//コーナマーカの時
//地区大会では何もしない
@@ -359,7 +358,7 @@
Stop_Distance=0;
Machine_Status&=0x7F;//ストップ状態解除
}else{//機体走行中であったとき
- //各種フラグのクリア
+ //各種フラグのクリア
Corner_Flag=0;
SG_Flag=0;
Cross_Flag=0;