[[2019a/Member]] 目次 #contents *課題について [#zec7920d] *ロボット本体の説明 [#y9f1b9f5] *プログラムの説明 [#jfa17a99] #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); }