[[2019a/Member]]
*目次 [#he55ec40]
1.課題について~
2.NXTについて~
3.プログラミングについて

ふぃおdvひおdhゔぃおwhゔぃ
*課題について [#g544dbd2]
○今回の課題

・これまで住んだことのある都道府県名、市町村名、地区名などの中から2文字以上、かつ合計10画以上のものを選び、それをA4の紙を書くロボットを製作せよ。 

○選んだ文字

自分の出身地である「神戸」にした。

*NXTについて [#b405425e]

今回制作したロボット~
前輪二輪の中心にペンを置き、後輪は一輪のシンプルなデザインにした。(下の添付ファイル右側参照)これは、シンプルなロボットにすることで、製作時間を短縮し、プログラミングおよび調整に時間をかけようと考えたからである。また、ペンはモーターを使って上下に動かせるようにした。

*プログラミングについて [#xac941ba]

 #define PEN_TIME 100
 #define pen_rize OnRev(OUT_A,50);Wait(PEN_TIME);Off(OUT_A);
 #define pen_down OnFwd(OUT_A,50);Wait(PEN_TIME);Off(OUT_A);
 #define W Wait(700);
 sub rotation_right(long t)
 {
     OnFwd(OUT_C,50);OnRev(OUT_B,50);Wait(t);Off(OUT_BC);
 }
 sub rotation_left(long t)
 {
     OnFwd(OUT_B,50);OnRev(OUT_C,50);Wait(t);Off(OUT_BC);
 }
 sub go_straight(long t)
 {
     OnFwd(OUT_BC,50);Wait(t);Off(OUT_BC);
 }
 sub back_straight(long t)
 {
     OnRev(OUT_BC,50);Wait(t);Off(OUT_BC);
 }
 sub curve_right(long t)
 {
     OnFwd(OUT_C,50);OnFwd(OUT_B,15);Wait(t);Off(OUT_BC);
 }
 sub back_curve_right(long t)
 {
     OnRev(OUT_C,50);OnRev(OUT_B,15);Wait(t);Off(OUT_BC);
 }
 task main()
 {
     go_straight(100);
     W;
     pen_rize;
     W;
     go_straight(100);
     W;
     rotation_right(550);
     W;
     go_straight(100);
     W;
     pen_down;
     W;
     back_straight(100);
     W;
     rotation_left(400);
     W;
     curve_right(700);
     W;
     pen_rize;
     W;
     back_curve_right(450);
     W;
     rotation_left(400);
     W;
     pen_down;
     W;
     go_straight(100);
     W;
     pen_rize;
     W;
     back_straight(100);
     W;
     rotation_right(400);
     W;
     pen_down;
     W;
     go_straight(450);
     W;
     pen_rize;
     W;
     rotation_left(600);
     W;
     go_straight(200);
     W;
     rotation_left(600);
     W;
     go_straight(350);
     W;
     pen_down;
     W;
     go_straight(200);
     W;
     rotation_right(650);
     W;
     go_straight(250);
     W;
     rotation_right(650);
     W;
     go_straight(200);
     W;
     rotation_right(650);
     W;
     go_straight(250);
     W;
     pen_rize;
     W;
     rotation_right(650);
     W;
     go_straight(150);
     W;
     rotation_right(650);
     W;
     pen_down;
     W;
     go_straight(250);
     W;
     pen_rize;
     W;
     back_straight(125);
     W;
     rotation_right(600);
     W;
     back_straight(250);
     W;
     pen_down;
     W;
     go_straight(600);
     W;
     pen_rize;
     W;
     go_straight(200);
     W;
     rotation_right(600);
     W;
     pen_down;
     W;
     go_straight(300);
     W;
     pen_rize;
     W;
     rotation_left(600);
     W;
     go_straight(150);
     W;
     rotation_left(600);
     W;
     pen_down;
     W;
     go_straight(300);
     W;
     rotation_right(650);
     W;
     go_straight(150);
     W;
     rotation_right(650);
     W;
     go_straight(300);
     W;
     pen_rize;
     W;
     rotation_left(650);
     W;
     back_straight(150);
     W;
     pen_down;
     W;
     go_straight(150);
     W;
     curve_right(500);
 }


構造としては、最初に「神戸」を書く上で行う全ての動作を#defineで定義し、Wait(t)のtを調節することで文字を書こうと試みた。結果としてはかなり調節に時間を有したが、うまくいった。(下の添付ファイル左側参照)

*まとめ [#v2ec6303]
今回の課題では、ロボットの製作よりもプログラミングの調整が大変だった。また、回数を重ねるごとにロボットの動き方が変わるという問題にも衝突し、最後まで原因はわからなかった。今後は問題が見つかれば、原因の特定と対策を確実に行い、効率的な作業を行えるようにする。


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS