2015a/Member/senbeipan/Mission2
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*はじめに [#n5e6becd]
今回の課題は黒いラインをトレースしてゴールにシュートする...
#ref(コース.png)
*ロボットの概観 [#n4f7960a]
タイヤを支えている棒にブロックを取り付け、車体の正面に取...
#ref(./1437033944047.jpg,30%)
*プログラム [#b6609d9b]
#define go OnFwd(OUT_AC);//直進
#define right OnFwd(OUT_A);//右にゆるやかに進む
#define left OnFwd(OUT_C);//左にゆるやかに進む
#define turnright OnRev(OUT_C);OnFwd(OUT_A);//右に旋回
#define turnleft OnRev(OUT_A);OnFwd(OUT_C);//左に旋回
#define open OnRev(OUT_B);Wait(100);//アームを開く
#define close OnFwd(OUT_B);Wait(100);//アームを閉じる
task main()
{
SetSensor(SENSOR_3,SENSOR_LIGHT);
ClearTimer(0);
while (FastTimer(0) < 23) {
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
Wait(200);
close;Off(OUT_B);
left;Wait(30);
ClearTimer(0);
while (FastTimer(0) < 31) {
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
Wait(200);
left;
Wait(30);
ClearTimer(0);
while (FastTimer(0) < 25) {
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
OnRev(OUT_A);
Wait(25);
Off(OUT_AC);
open;
Off(OUT_AC);
go;
Wait(25);
Off(OUT_ABC);
}
*説明 [#ra1738ec]
**全体として [#y6d47f4e]
今回のプログラムはラインの右側を沿って動くようにしました...
#ref(./無題.png,40%)
**?について [#zce18519]
while (FastTimer(0) < 23) {
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
Wait(200);
close;
Off(OUT_B);
left;
Wait(30);
ClearTimer(0);
タイマーで交差点を認識させた後2秒停止し、左方向に動かすこ...
**?について [#yada08fa]
while (FastTimer(0) < 31){
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
Wait(200);
left;
Wait(30);
ClearTimer(0);
途中のカーブが急だったので交差点の認識時間を長くしました...
**?と?について [#ye38dfd4]
while (FastTimer(0) < 25) {
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
OnRev(OUT_A);//三叉路に垂直に向かうために
Wait(25);
Off(OUT_AC);
open;
Off(OUT_AC);
go;
Wait(25);
Off(OUT_ABC);
?のシュートをするときは三叉路を認識した後左の車輪を後転さ...
*感想・まとめ [#q2e6863d]
プログラミングに関しては難しくグループ内で教えてもらいな...
終了行:
*はじめに [#n5e6becd]
今回の課題は黒いラインをトレースしてゴールにシュートする...
#ref(コース.png)
*ロボットの概観 [#n4f7960a]
タイヤを支えている棒にブロックを取り付け、車体の正面に取...
#ref(./1437033944047.jpg,30%)
*プログラム [#b6609d9b]
#define go OnFwd(OUT_AC);//直進
#define right OnFwd(OUT_A);//右にゆるやかに進む
#define left OnFwd(OUT_C);//左にゆるやかに進む
#define turnright OnRev(OUT_C);OnFwd(OUT_A);//右に旋回
#define turnleft OnRev(OUT_A);OnFwd(OUT_C);//左に旋回
#define open OnRev(OUT_B);Wait(100);//アームを開く
#define close OnFwd(OUT_B);Wait(100);//アームを閉じる
task main()
{
SetSensor(SENSOR_3,SENSOR_LIGHT);
ClearTimer(0);
while (FastTimer(0) < 23) {
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
Wait(200);
close;Off(OUT_B);
left;Wait(30);
ClearTimer(0);
while (FastTimer(0) < 31) {
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
Wait(200);
left;
Wait(30);
ClearTimer(0);
while (FastTimer(0) < 25) {
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
OnRev(OUT_A);
Wait(25);
Off(OUT_AC);
open;
Off(OUT_AC);
go;
Wait(25);
Off(OUT_ABC);
}
*説明 [#ra1738ec]
**全体として [#y6d47f4e]
今回のプログラムはラインの右側を沿って動くようにしました...
#ref(./無題.png,40%)
**?について [#zce18519]
while (FastTimer(0) < 23) {
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
Wait(200);
close;
Off(OUT_B);
left;
Wait(30);
ClearTimer(0);
タイマーで交差点を認識させた後2秒停止し、左方向に動かすこ...
**?について [#yada08fa]
while (FastTimer(0) < 31){
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
Wait(200);
left;
Wait(30);
ClearTimer(0);
途中のカーブが急だったので交差点の認識時間を長くしました...
**?と?について [#ye38dfd4]
while (FastTimer(0) < 25) {
if(SENSOR_3>50){
turnleft;
ClearTimer(0);
}
else if(SENSOR_3>46){
left;
ClearTimer(0);
}
else if(SENSOR_3>39){
go;
ClearTimer(0);
}
else if(SENSOR_3>35){
right;
}
else{
turnright;
}
}
Off(OUT_AC);
OnRev(OUT_A);//三叉路に垂直に向かうために
Wait(25);
Off(OUT_AC);
open;
Off(OUT_AC);
go;
Wait(25);
Off(OUT_ABC);
?のシュートをするときは三叉路を認識した後左の車輪を後転さ...
*感想・まとめ [#q2e6863d]
プログラミングに関しては難しくグループ内で教えてもらいな...
ページ名: