2017a/Member/nide/Mission2
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
目次
#contents
*課題について [#pad2e805]
[[2017a/Mission2]]を参照してください。
今回はE地点直進コースわやりました。
*ロポットについて [#f038beb0]
**ロボットの大きさについて [#n91fcdff]
#ref(./IMG_201707_1.jpg,50%,ロポットの大きさ)
今回は車体に大きなタイヤを使わないことで機体を小さくでき...
**ロボットの裏側 [#v3dd1d51]
#ref(./IMG_201707_2.jpg,50%,ロボットの裏側)
工夫したところは裏側である。黒いパーツを使うことで機体を...
*ライントレースのプログラムについて [#xc0bfe89]
**定義について [#j2bcb4bb]
#define TURN_left OnRev(OUT_A); Wait(5); OnFwd(OUT_A);
#define TURN_right OnRev(OUT_C); Wait(5); OnFwd(OUT_C);
#define overTURN_left SetPower(OUT_C,1); OnRev(OUT_A); ...
SetPower(OUT_C,3); OnFwd(OUT_A);
#define overTURN_right SetPower(OUT_A,1); OnRev(OUT_C);...
SetPower(OUT_A,3); OnFwd(OUT_C);
int min_time; //lineをする時間を定義している//
このプログラム上の定義は、このようになっている。前回と同...
**subについて [#q88edaad]
sub line()
{
SetPower(OUT_AC,3);
SetSensor(SENSOR_2,SENSOR_LIGHT);
ClearTimer(0); //0番目のタイマーリセットする//
while(FastTimer(0)<min_time){
OnFwd(OUT_AC);
if(SENSOR_2<42&&FastTimer(0)<min_time){
overTURN_left;
}else if(SENSOR_2<44&&FastTimer(0)<min_time){
TURN_left;
}else if(SENSOR_2<46&&FastTimer(0)){
}else if(SENSOR_2<51&&FastTimer(0)){
TURN_right;
}else if(FastTimer(0)<min_time){
overTURN_right;
}
}
}
subでは動く速さを変えることで光センサーが反応しやすくして...
**プログラムについて [#g2c8a77d]
task main()
{
min_time=2680;
line();
PlaySound(SOUND_UP);
OnFwd(OUT_AC);
ClearTimer(0); //A→E E→F//
min_time=450;
line();
PlaySound(SOUND_DOWN);
Off(OUT_AC);
Wait(100);
ClearTimer(0); //F→Q//
min_time=480;
line();
PlaySound(SOUND_UP);
OnFwd(OUT_AC);
Wait(20);
ClearTimer(0); //Q→R//
min_time=1350;
line();
PlaySound(SOUND_UP);
ClearTimer(0); //R→S//
min_time=400;
line();
PlaySound(SOUND_UP);
ClearTimer(0); //S→G//
min_time=3120;
line();
PlaySound(SOUND_UP);
ClearTimer(0);//G→H//
min_time=375;
line();
PlaySound(SOUND_DOWN);
Off(OUT_AC);
Wait(100);
OnFwd(OUT_AC);
Wait(10);
ClearTimer(0); //H→T//
min_time=1230;
line();
PlaySound(SOUND_DOWN);
Off(OUT_AC); Wait(100);
OnFwd(OUT_AC);
Wait(10);
ClearTimer(0); //T→T//
ここは円を一周している。
min_time=890;
line();
PlaySound(SOUND_DOWN);
Off(OUT_AC);
Wait(100);
ClearTimer(0); //T→R//
min_time=600;
line();
PlaySound(SOUND_UP);
OnFwd(OUT_AC);
Wait(10);
ClearTimer(0); //R→S//
min_time=840;
line();
PlaySound(SOUND_UP);
ClearTimer(0); //S→P//
min_time=550;
line();
PlaySound(SOUND_DOWN);
Off(OUT_AC);
Wait(100);
ClearTimer(0); //P→E//
min_time=600;
line();
Off(OUT_AC); //E→A//
}
上記で示したmin_timeを毎回定義してその間だけlineを実行し...
**アドバイスとして [#g04a1f98]
実際PlaySoundのところは、ロボット自身に判定させる(overTU...
(実際に最後まではやることができませんでしたが参考にしてみ...
sub find()
{ OnFwd(OUT_AC);
TURN_right;
TURN_right;
TURN_right;
TURN_right;
Off(OUT_AC);
Wait(10);
if(SENSOR_2<48){
OnFwd(OUT_AC);
TURN_left;
TURN_left;
TURN_left;
TURN_left;
TURN_left;
TURN_left;
TURN_left;
TURN_left;
Off(OUT_AC);
Wait(10);
if(SENSOR_2<48){
OnFwd(OUT_AC);
TURN_right;
TURN_right;
TURN_right;
TURN_right;
PlaySound(SOUND_DOWN);
Off(OUT_AC);
Wait(100);
}else{
OnFwd(OUT_AC);
TURN_right;
TURN_right;
TURN_right;
TURN_right;
PlaySound(SOUND_UP);
Wait(10);
}
}else{
OnFwd(OUT_AC);
TURN_left;
TURN_left;
TURN_left;
TURN_left;
PlaySound(SOUND_UP);
Wait(10);
}
}
このsubでUP/DOWNを判断する{これは検証して一応出来た}
それで時間は変わるだろう(findで結構本体動いたりするから...
*感想 [#ue2695a5]
今回もとても苦労し楽しかった。本来ならカウントを使うほう...
終了行:
目次
#contents
*課題について [#pad2e805]
[[2017a/Mission2]]を参照してください。
今回はE地点直進コースわやりました。
*ロポットについて [#f038beb0]
**ロボットの大きさについて [#n91fcdff]
#ref(./IMG_201707_1.jpg,50%,ロポットの大きさ)
今回は車体に大きなタイヤを使わないことで機体を小さくでき...
**ロボットの裏側 [#v3dd1d51]
#ref(./IMG_201707_2.jpg,50%,ロボットの裏側)
工夫したところは裏側である。黒いパーツを使うことで機体を...
*ライントレースのプログラムについて [#xc0bfe89]
**定義について [#j2bcb4bb]
#define TURN_left OnRev(OUT_A); Wait(5); OnFwd(OUT_A);
#define TURN_right OnRev(OUT_C); Wait(5); OnFwd(OUT_C);
#define overTURN_left SetPower(OUT_C,1); OnRev(OUT_A); ...
SetPower(OUT_C,3); OnFwd(OUT_A);
#define overTURN_right SetPower(OUT_A,1); OnRev(OUT_C);...
SetPower(OUT_A,3); OnFwd(OUT_C);
int min_time; //lineをする時間を定義している//
このプログラム上の定義は、このようになっている。前回と同...
**subについて [#q88edaad]
sub line()
{
SetPower(OUT_AC,3);
SetSensor(SENSOR_2,SENSOR_LIGHT);
ClearTimer(0); //0番目のタイマーリセットする//
while(FastTimer(0)<min_time){
OnFwd(OUT_AC);
if(SENSOR_2<42&&FastTimer(0)<min_time){
overTURN_left;
}else if(SENSOR_2<44&&FastTimer(0)<min_time){
TURN_left;
}else if(SENSOR_2<46&&FastTimer(0)){
}else if(SENSOR_2<51&&FastTimer(0)){
TURN_right;
}else if(FastTimer(0)<min_time){
overTURN_right;
}
}
}
subでは動く速さを変えることで光センサーが反応しやすくして...
**プログラムについて [#g2c8a77d]
task main()
{
min_time=2680;
line();
PlaySound(SOUND_UP);
OnFwd(OUT_AC);
ClearTimer(0); //A→E E→F//
min_time=450;
line();
PlaySound(SOUND_DOWN);
Off(OUT_AC);
Wait(100);
ClearTimer(0); //F→Q//
min_time=480;
line();
PlaySound(SOUND_UP);
OnFwd(OUT_AC);
Wait(20);
ClearTimer(0); //Q→R//
min_time=1350;
line();
PlaySound(SOUND_UP);
ClearTimer(0); //R→S//
min_time=400;
line();
PlaySound(SOUND_UP);
ClearTimer(0); //S→G//
min_time=3120;
line();
PlaySound(SOUND_UP);
ClearTimer(0);//G→H//
min_time=375;
line();
PlaySound(SOUND_DOWN);
Off(OUT_AC);
Wait(100);
OnFwd(OUT_AC);
Wait(10);
ClearTimer(0); //H→T//
min_time=1230;
line();
PlaySound(SOUND_DOWN);
Off(OUT_AC); Wait(100);
OnFwd(OUT_AC);
Wait(10);
ClearTimer(0); //T→T//
ここは円を一周している。
min_time=890;
line();
PlaySound(SOUND_DOWN);
Off(OUT_AC);
Wait(100);
ClearTimer(0); //T→R//
min_time=600;
line();
PlaySound(SOUND_UP);
OnFwd(OUT_AC);
Wait(10);
ClearTimer(0); //R→S//
min_time=840;
line();
PlaySound(SOUND_UP);
ClearTimer(0); //S→P//
min_time=550;
line();
PlaySound(SOUND_DOWN);
Off(OUT_AC);
Wait(100);
ClearTimer(0); //P→E//
min_time=600;
line();
Off(OUT_AC); //E→A//
}
上記で示したmin_timeを毎回定義してその間だけlineを実行し...
**アドバイスとして [#g04a1f98]
実際PlaySoundのところは、ロボット自身に判定させる(overTU...
(実際に最後まではやることができませんでしたが参考にしてみ...
sub find()
{ OnFwd(OUT_AC);
TURN_right;
TURN_right;
TURN_right;
TURN_right;
Off(OUT_AC);
Wait(10);
if(SENSOR_2<48){
OnFwd(OUT_AC);
TURN_left;
TURN_left;
TURN_left;
TURN_left;
TURN_left;
TURN_left;
TURN_left;
TURN_left;
Off(OUT_AC);
Wait(10);
if(SENSOR_2<48){
OnFwd(OUT_AC);
TURN_right;
TURN_right;
TURN_right;
TURN_right;
PlaySound(SOUND_DOWN);
Off(OUT_AC);
Wait(100);
}else{
OnFwd(OUT_AC);
TURN_right;
TURN_right;
TURN_right;
TURN_right;
PlaySound(SOUND_UP);
Wait(10);
}
}else{
OnFwd(OUT_AC);
TURN_left;
TURN_left;
TURN_left;
TURN_left;
PlaySound(SOUND_UP);
Wait(10);
}
}
このsubでUP/DOWNを判断する{これは検証して一応出来た}
それで時間は変わるだろう(findで結構本体動いたりするから...
*感想 [#ue2695a5]
今回もとても苦労し楽しかった。本来ならカウントを使うほう...
ページ名: