[[2018a/Member]]

*書道ロボット [#r9f4a6e3]
目次

#contents

 taskmain
 {
  naruhodo
**見出し [#y9a419c1]
-モータA:右モータ
-モータB:左モータ


**プログラム [#p3248c2a]
 #define pen_up OnFwd(OUT_C);Wait(15);Off(OUT_C);//ペンを上げる
 #define pen_down OnRev(OUT_C);Wait(15);Off(OUT_C);//ペンを下げる
 #define offB Off(OUT_B);
 #define offA Off(OUT_A);
 #define wait Wait(30);
 task main()
 {
         pen_down;
         OnFwd(OUT_B);
         Wait(25);
         offB;//一画目
         OnFwd(OUT_A);
         Wait(35);
         offA;
         wait;//二画目
         OnRev(OUT_B);
         Wait(25);
         offB;//三角目
         OnRev(OUT_A);
         Wait(43);
         offA;
         wait;//四角目
         pen_up;
         OnFwd(OUT_B);
         Wait(13);
         offB;
         OnFwd(OUT_A);
         Wait(10);
         offA;//位置調整
         pen_down;//五番目
         OnFwd(OUT_A);
         Wait(40);
         offA;//6画目
         pen_up;
         OnRev(OUT_A);
         Wait(20);
         offA;//7番目
         pen_down;
         wait;
         OnFwd(OUT_B);
         Wait(13);//8番目
         offB;
         OnRev(OUT_B);
         Wait(26);
         offB;//9画目
         wait;
         pen_up;//ここまでで”田”
         OnFwd(OUT_A);
         Wait(40);
         offA;
         wait;
         pen_down;
         wait;
         OnFwd(OUT_A);
         Wait(40);
         offA;//一画目
         pen_up;
         OnRev(OUT_A);
         Wait(40);
         offA;
         pen_down;
         OnFwd(OUT_B);
         Wait(50);
         offB;//はらいが終了
         wait;
         pen_up;
         OnRev(OUT_B);
         Wait(45);
         offB;
         wait;
         OnFwd(OUT_A);
         Wait(16);
         offA;
         wait;
         pen_down;
         wait;
         OnFwd(OUT_B);
         Wait(7);
         offB;//3画目
         OnFwd(OUT_A);
         Wait(19);
         offA;
         wait;
         OnFwd(OUT_B);
         Wait(10);
         offB;
         wait;
         OnRev(OUT_A);
         Wait(40);
         offA;
         wait;
         OnRev(OUT_B);
         Wait(10);
         offB;
         OnFwd(OUT_A);
         Wait(40);
         offA;
         wait;
         OnFwd(OUT_B);
         Wait(5);
         offB;
         wait;
         OnRev(OUT_A);
         Wait(40);
         offA;
         wait;//4画目
         pen_up;
         OnFwd(OUT_A);
         Wait(19);
         offA;
         OnFwd(OUT_B);
         Wait(7);
         offB;
         wait;
         pen_down;
         OnFwd(OUT_B);
         Wait(20);
         offB;
         wait;
         pen_up;//5画目
         OnRev(OUT_A);
         Wait(13);
         offA;
         OnRev(OUT_B);
         Wait(13);
         offB;
         pen_down;
         OnFwd(OUT_B);
         Wait(5);
         offB;//6画目
         wait;
         pen_up;
         OnFwd(OUT_A);
         Wait(20);
         offA;
         pen_down;
         OnRev(OUT_B);
         Wait(5);
         offB;//7画目
         pen_up;
 }






#define pen_up OnFwd(OUT_C);Wait(15);Off(OUT_C);//ペンを上げる
#define pen_down OnRev(OUT_C);Wait(15);Off(OUT_C);//ペンを下げる
#define offB Off(OUT_B);
#define offA Off(OUT_A);
#define wait Wait(30);
task main()
{
	pen_down;
	OnFwd(OUT_B);
	Wait(25);
	offB;//一画目
	OnFwd(OUT_A);
	Wait(35);
	offA;
	wait;//二画目
	OnRev(OUT_B);
	Wait(25);
	offB;//三角目
	OnRev(OUT_A);
	Wait(45);
	offA;
	wait;//四角目
	pen_up;//位置調整、始
	OnFwd(OUT_B);
	Wait(15);
	offB;
	OnFwd(OUT_A);
	Wait(10);
	offA;//位置調整、終
	pen_down;//五番目
	OnFwd(OUT_A);
	Wait(35);
	offA;//6画目
	pen_up;
	OnRev(OUT_A);
	Wait(20);//変更点
	offA;//7番目
	pen_down;
	wait;
	OnFwd(OUT_B);
	Wait(13);//8番目
	offB;
	OnRev(OUT_B);
	Wait(26);
	offB;//9画目
	wait;
	pen_up;//ここまでで”田”
	OnFwd(OUT_A);
	Wait(40);
	offA;
	wait;
	pen_down;
	wait;
	OnFwd(OUT_A);
	Wait(40);
	offA;//一画目
	pen_up;
	OnRev(OUT_A);
	Wait(40);
	offA;
	pen_down;
	OnFwd(OUT_B);
	Wait(50);
	offB;//はらいが終了
	wait;
	pen_up;
	OnRev(OUT_B);
	Wait(45);
	offB;
	wait;
	OnFwd(OUT_A);
	Wait(16);
	offA;
	wait;
	pen_down;
	wait;
	OnFwd(OUT_B);
	Wait(7);
	offB;//3画目
	OnFwd(OUT_A);
	Wait(19);
	offA;
	wait;
	OnFwd(OUT_B);
	Wait(10);
	offB;
	wait;
	OnRev(OUT_A);
	Wait(40);
	offA;
	wait;
	OnRev(OUT_B);
	Wait(10);
	offB;
	OnFwd(OUT_A);
	Wait(40);
	offA;
	wait;
	OnFwd(OUT_B);
	Wait(5);
	offB;
	wait;
	OnRev(OUT_A);
	Wait(40);
	offA;
	wait;//4画目
	pen_up;
	OnFwd(OUT_A);
	Wait(19);
	offA;
	OnFwd(OUT_B);
	Wait(7);
	offB;
	wait;
	pen_down;
	OnFwd(OUT_B);
	Wait(20);
	offB;
	wait;
	pen_up;//5画目
	OnRev(OUT_A);
	Wait(13);
	offA;
	OnRev(OUT_B);
	Wait(13);
	offB;
	pen_down;
	OnFwd(OUT_B);
	Wait(5);
	offB;//6画目
	wait;
	pen_up;
	OnFwd(OUT_A);
	Wait(20);
	offA;
	pen_down;
	OnRev(OUT_B);
	Wait(5);
	offB;//7画目
	pen_up;
}


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