2017a/Member/ejj/Mission2
¤ò¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤·¤ÆºîÀ®
[
¥È¥Ã¥×
] [
¿·µ¬
|
°ìÍ÷
|
¸¡º÷
|
ºÇ½ª¹¹¿·
|
¥Ø¥ë¥×
|
¥í¥°¥¤¥ó
]
³«»Ï¹Ô:
[[2017a/Member]]
Ìܼ¡
#contents
*²ÝÂê¤Ë¤Ä¤¤¤Æ [#sf1e746c]
£²¤ÄÌܤβÝÂê¤Ï¼¡¤Î·ÐÏ©¤ò¹õ¤¤Àþ¤Ë¤½¤Ã¤ÆÆ°¤¯¥í¥Ü¥Ã¥È¤òºîÀ®¤¹¤ë¤È¤¤¤¦¤â¤Î¤À¤Ã¤¿¡£
&ref(2017a/Member/ejj/Mission2/pic_ejj9.JPG,100%,);
A¥¹¥¿¡¼¥È¢ªEľ¿Ê¢ªF(SOUND_UP)¢ªQ°ì»þÄä»ß(SOUND_DOWN)¡õº¸ÀÞ¢ªRľ¿Ê(SOUND_UP)¢ªSº¸ÀÞ(SOUND_UP)¢ªG(SOUND_UP)¢ªH(SOUND_UP)¢ªT°ì»þÄä»ß(SOUND_DOWN)¡õľ¿Ê¢ªT°ì»þÄä»ß(SOUND_DOWN)¡õľ¿Ê¢ªR°ì»þÄä»ß(SOUND_DOWN)¡õº¸ÀÞ¢ªSľ¿Ê(SOUND_UP)¢ªPº¸ÀÞ(SOUND_UP)¢ªE°ì»þÄä»ß(SOUND_DOWN)¡õº¸ÀÞ¢ªAÄä»ß(SOUND_DOWN)
¤¿¤À¤·¡¢
¡¡¡¡¡¤Ê¤ë¤Ù¤¯Â®¤¯Àµ³Î¤Ëư¤¯¥í¥Ü¥Ã¥È¤Ë¤Ê¤ë¤è¤¦¤Ë¹©Éפ¹¤ë¤³¤È¡£
¡¡¡¡¢°ì»þÄä»ß¤Î¸òº¹ÅÀ¤ª¤è¤ÓÃú»úÏ©¤Ç¤ÏSOUND_DOWN¤òÌĤ餷¤¿¸å¡¢1ÉôÖÄä»ß¤¹¤ë¤³¤È¡£
¡¡¡¡£Ä¾³Ñ¥³¡¼¥Ê¡¼¤ª¤è¤Ó°ì»þÄä»ß¤¬ÉÔÍפÏÃú»úÏ©¤Ç¤ÏSOUND_UP¤òÌĤ餷¡¢Ää»ß¤·¤Ê¤¤¤Ç¿Ê¤à¤³¤È
¡£
¡¡¡¡¤¥í¥Ü¥Ã¥È¤Ï¥µ¥¤¥º¤Ï¡¢Éý15cmŤµ18cm°ÊÆâ¤È¤¹¤ë¡Ê¹â¤µ¤Ï̵À©¸Â¡Ë¡£
¡¡¡¡¥¸òº¹ÅÀ¡¢Ãú»úÏ©¡¢Ä¾³Ñ¥³¡¼¥Ê¡¼¤Ë¤Ä¤¤¤Æ¤Ï¡¢º¹¤·³Ý¤«¤Ã¤¿»þÅÀ¤ÇȽÊ̤¹¤ë¤â¤Î¤È¤·¡¢Í½¤áÀßÄꤷ¤¿Áö¹Ô»þ´Ö¤Î¤ß¤ÇȽÄꤷ¤¿¤ê¡¢Áö¹Ôµ÷Î¥¤Î¤ß¤ÇȽÄꤷ¤Æ¤Ï¡¡¡¡¡¡¤Ê¤é¤Ê¤¤¡£
¤È¤¤¤¦¤Î¤¬¾ò·ï¤À¤Ã¤¿¡£
*¥í¥Ü¥Ã¥È¤ÎÀâÌÀ [#tbb73ed0]
Ⱦ·Â¤Î¾®¤µ¤Ê¶ÊÀþ¤â¤Ê¤ë¤Ù¤¯Íưפ˶ʤ¬¤ì¤ë¤è¤¦¤Ë¥â¡¼¥¿¡¼¤Îµ÷Î¥¤òºÇ¾®¸Â¤Ë¤·¤¿¡£¤µ¤é¤Ë¡¢²óž¤äÀû²ó¤Î»þ¤Ë´ù¤È¤ÎË໤¤¬¾®¤µ¤¯¤Ê¤ë¤è¤¦¤Ë¥¿¥¤¥ä¤Ï»°Îؤˤ·¡¢°ì¤Ä¤Ï¥´¥à¤Î¤Ä¤¤¤Æ¤Ê¤¤¤â¤Î¤Ë¤·¤¿¡£¤Þ¤¿¡¢¼Ö¼´¤«¤é¤Î¥»¥ó¥µ¡¼¤ÎÃúÅÙ¤¤¤¤µ÷Î¥¤¬ÁȤßΩ¤Æ¤ë»þÅÀ¤Ç¤Ïʬ¤«¤é¤Ê¤«¤Ã¤¿¤Î¤Ç¡¢¸å¤«¤é¼«Í³¤ËÊѤ¨¤ë¤³¤È¤¬²Äǽ¤Ê¤è¤¦¤ËÁȤßΩ¤Æ¤¿¡£¤½¤ÎÉôʬ¤¬¤â¤í¤¤¤Î¤¬ÆñÅÀ¤À¤Ã¤¿¤¬¡¢µ÷Î¥¤ò´Êñ¤ËÊѤ¨¤é¤ì¤ë¤Î¤Ï·ë²ÌŪ¤Ëºî¶È¤Î¸úΨ¤ò¾å¤²¤¿¡£¼Ö¼´¤ÎÃæ¿´¤È¥»¥ó¥µ¡¼¤Îµ÷Î¥¤Ï¥Ö¥í¥Ã¥¯Æó¸Äʬ¤¬¤Á¤ç¤¦¤É¤è¤«¤Ã¤¿¡£
&ref(2017a/Member/ejj/Mission2/pic_ejj10.JPG,100%,);
&ref(2017a/Member/ejj/Mission2/pic_ejj11.JPG,100%,);
&ref(2017a/Member/ejj/Mission2/pic_ejj12.JPG,100%,);
*¥×¥í¥°¥é¥à¤ÎÀâÌÀ [#af311e06]
**ÄêµÁ [#z17b8dc5]
#define BLACK 39 //¤³¤ì¤è¤ê¾®¤µ¤¤¤È¹õ
#define BLACK_gray 42
#define GRAY 45
#define WHITE_gray 48
#define WHITE 50 //¤³¤ì¤è¤êÂ礤¤¤ÈÇò
#define RIGHT_S OnFwd(OUT_A); OnRev(OUT_C); //±¦Àû²ó
#define LEFT_S OnFwd(OUT_C); OnRev(OUT_A); //º¸Àû²ó
#define RIGHT_K OnFwd(OUT_A); Off(OUT_C); //±¦²óž
#define LEFT_K OnFwd(OUT_C); Off(OUT_A); //º¸²óž
#define GO_FORWARD OnFwd(OUT_AC); //Á°¿Ê£±
#define GO_FORWARD2(t) OnFwd(OUT_AC);Wait(t);Off(OUT_AC);//Á°¿Ê£²
**¥µ¥Ö¥ë¡¼¥Á¥ó [#e1da1893]
¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó£±¡£90Å٤˸ò¤ï¤ë¸òº¹ÅÀ¤òǧ¼±¤·¤Æ²»¡ÊSOUND_UP)¤òÌĤ餹¡£
sub LINE1a()
{
ClearTimer(0);
while(FastTimer(0)<22)
{
if(SENSOR_2>=WHITE){RIGHT_S;ClearTimer(0);}
else if(SENSOR_2>=WHITE_gray){RIGHT_K;ClearTimer(0);}
else if(SENSOR_2>=GRAY){GO_FORWARD;ClearTimer(0);}
else if(SENSOR_2>=BLACK_gray){LEFT_K;ClearTimer(0);}
else{LEFT_S;}
}
Off (OUT_AC);
PlaySound(SOUND_UP);
}
¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó£²¡£90Åٰʾå¤Î³ÑÅ٤Ǹò¤ï¤ë¸òº¹ÅÀ¤òǧ¼±¤·¤Æ²»¡ÊSOUND_UP)¤òÌĤ餹¡£
sub LINE1b()
{
ClearTimer(0);
while(FastTimer(0)<19)
{
if(SENSOR_2>=WHITE){RIGHT_S;ClearTimer(0);}
else if(SENSOR_2>=WHITE_gray){RIGHT_K;ClearTimer(0);}
else if(SENSOR_2>=GRAY){GO_FORWARD;ClearTimer(0);}
else if(SENSOR_2>=BLACK_gray){LEFT_K;ClearTimer(0);}
else{LEFT_S;}
}
Off (OUT_AC);
PlaySound(SOUND_UP);
}
¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó£³¡£²»¤òÌĤ餵¤º¤Ë¼¡¤Î¥×¥í¥°¥é¥à¤Ë¿Ê¤à¡£
sub LINE1c()
{
ClearTimer(0);
while(FastTimer(0)<22)
{
if(SENSOR_2>=WHITE){RIGHT_S;ClearTimer(0);}
else if(SENSOR_2>=WHITE_gray){RIGHT_K;ClearTimer(0);}
else if(SENSOR_2>=GRAY){GO_FORWARD;ClearTimer(0);}
else if(SENSOR_2>=BLACK_gray){LEFT_K;ClearTimer(0);}
else{LEFT_S;}
}
}
¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó£´¡£¸òº¹ÅÀ¤òǧ¼±¤·¤Æ²»¡ÊSOUND_DOWN¡Ë¤òÌĤ餷¤¿¸å¡¢1ÉÃÄä»ß¤¹¤ë¡£
sub LINE2()
{
ClearTimer(0);
while(FastTimer(0)<22)
{
if(SENSOR_2>=WHITE){RIGHT_S;ClearTimer(0);}
else if(SENSOR_2>=WHITE_gray){RIGHT_K;ClearTimer(0);}
else if(SENSOR_2>=GRAY){GO_FORWARD;ClearTimer(0);}
else if(SENSOR_2>=BLACK_gray){LEFT_K;ClearTimer(0);}
else{LEFT_S;}
}
Off (OUT_AC);
PlaySound(SOUND_DOWN);
Wait(100);
}
0.8Éú¸Àû²ó¤¹¤ë¥µ¥Ö¥ë¡¼¥Á¥ó¡£
sub CROSS_LEFT1()
{
while(FastTimer(0) < 80) {
LEFT_S;
}
ClearTimer(0);
}
2.2Éú¸²óž¤¹¤ë¥µ¥Ö¥ë¡¼¥Á¥ó¡£
sub CROSS_LEFT2()
{
while(FastTimer(0) < 220) {
LEFT_K;
}
ClearTimer(0);
}
1.2Éú¸²óž¤¹¤ë¥µ¥Ö¥ë¡¼¥Á¥ó¡£
sub CROSS_LEFT3()
{
while(FastTimer(0) < 120) {
LEFT_K;
}
ClearTimer(0);
}
0.8Éñ¦²óž¤¹¤ë¥µ¥Ö¥ë¡¼¥Á¥ó¡£
sub CROSS_RIGHT()
{
while(FastTimer(0) < 80) {
RIGHT_K;
}
ClearTimer(0);
}
**¥¿¥¹¥¯¥á¥¤¥ó [#p3728ba6]
task main()
{
SetSensor(SENSOR_2,SENSOR_LIGHT);
LINE1a(); //F¤Þ¤Ç
CROSS_LEFT1();
LINE2(); //Q¤Þ¤Ç
CROSS_LEFT2();
LINE1b(); //R¤Þ¤Ç
CROSS_RIGHT();
LINE1b(); //S¤Þ¤Ç
CROSS_LEFT3();
LINE1a(); //G¤Þ¤Ç
CROSS_LEFT3();
LINE1c();
CROSS_LEFT1();
LINE1c();
CROSS_LEFT1();
LINE1c();
CROSS_LEFT1();
LINE1a(); //H¤Þ¤Ç
CROSS_LEFT2();
LINE2(); //T¡Ê°ì²óÌܡˤޤÇ
GO_FORWARD2(30);
LINE2(); //T¡ÊÆó²óÌܡˤޤÇ
GO_FORWARD2(30);
LINE2(); //R¤Þ¤Ç
CROSS_LEFT2();
LINE1b(); //S¤Þ¤Ç
CROSS_RIGHT();
LINE1b(); //P¤Þ¤Ç
CROSS_LEFT3();
LINE2(); //E¤Þ¤Ç
CROSS_LEFT3();
LINE2(); //¥´¡¼¥ë
}
*¤Þ¤È¤á[#r040aa97]
**´¶ÁÛ [#pb79b8c0]
º£²ó¤Î²ÝÂê¤ÏÁ°²ó¤È¤Ï°ã¤¤¡¢¥í¥Ü¥Ã¥È¤ÏÈó¾ï¤Ë¥¹¥à¡¼¥º¤ËºîÀ®¤Ç¤¤¿¡£¤À¤¬¥×¥í¥°¥é¥à¤ÎÊý¤Ï¤È¤Æ¤âÊ£»¨¤À¤Ã¤¿¡£¥»¥ó¥µ¡¼¤ÎÃͤϾ¯¤·°ã¤¦¤À¤±¤Ç¤â¥í¥Ü¥Ã¥È¤¬Á´¤¯°ã¤¦Æ°¤¤ò¤¹¤ë¤Î¤Ç¡¢¤½¤Î»þ¤Ë¥»¥ó¥µ¡¼¤ÎÃͤ¬¤ª¤«¤·¤¤¤Î¤«¥×¥í¥°¥é¥à¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¤Î¤«¤ï¤«¤é¤º¶ìÏ«¤·¤¿¡£¤Þ¤¿¡¢¥í¥Ü¥Ã¥È¤¬¸òº¹ÅÀ¤ò¶Ê¤¬¤ë»þ¡¢Æ»¤¬¸ò¤ï¤ë³ÑÅÙ¤¬°ã¤¤¡¢¤Ê¤«¤Ê¤«¤¦¤Þ¤¯¤¤¤«¤Ê¤«¤Ã¤¿¡£Àþ¤ò¤¿¤É¤ë¥í¥Ü¥Ã¥È¤Èʹ¤¤¤¿¤é´Êñ¤½¤¦¤Ëʹ¤³¤¨¤ë¤±¤ì¤É¡¢ÁÛÁü°Ê¾å¤Ë»þ´Ö¤¬¤«¤«¤Ã¤¿¡£
**È¿¾Ê [#zbfaba39]
¤³¤Î¥í¥Ü¥Ã¥È¤ÏÉÔ´°Á´¤Ç¥´¡¼¥ë¤Þ¤Ç¤¿¤É¤êÃ失¤Ê¤¤»þ¤â¤¿¤Þ¤Ë¤¢¤ë¡£¤½¤ì¤Ï¥¹¥¿¡¼¥È¤Î»þ¤ÎÀþ¤È¥»¥ó¥µ¡¼¤Î°ÌÃÖ´Ø·¸¤ä¥í¥Ü¥Ã¥È¤òÃÖ¤¯³ÑÅ٤ˤè¤ë¤È¹Í¤¨¤é¤ì¤ë¡£¤Þ¤¿¡¢µÞÀû²ó¤ÎÉôʬ¤Ï¿Ê¤á¤ë¤è¤¦¤Ë¤Ï¤Ê¤Ã¤¿¤¬¡¢¥×¥í¥°¥é¥à¤Ï¤â¤Ã¤È¥·¥ó¥×¥ë¤Ë¤Ç¤¤½¤¦¤Ç¤â¤¢¤ë¡£ºÇ¸å¤Î²ÝÂê¤Ç¤Ï¾¯¤·¤Ç¤â´°àú¤Ë¶á¤Å¤±¤é¤ì¤ë¤è¤¦¤ËºÇ¸å¤Þ¤Ç¤ä¤ê¤¤ê¤¿¤¤¡£
½ªÎ»¹Ô:
[[2017a/Member]]
Ìܼ¡
#contents
*²ÝÂê¤Ë¤Ä¤¤¤Æ [#sf1e746c]
£²¤ÄÌܤβÝÂê¤Ï¼¡¤Î·ÐÏ©¤ò¹õ¤¤Àþ¤Ë¤½¤Ã¤ÆÆ°¤¯¥í¥Ü¥Ã¥È¤òºîÀ®¤¹¤ë¤È¤¤¤¦¤â¤Î¤À¤Ã¤¿¡£
&ref(2017a/Member/ejj/Mission2/pic_ejj9.JPG,100%,);
A¥¹¥¿¡¼¥È¢ªEľ¿Ê¢ªF(SOUND_UP)¢ªQ°ì»þÄä»ß(SOUND_DOWN)¡õº¸ÀÞ¢ªRľ¿Ê(SOUND_UP)¢ªSº¸ÀÞ(SOUND_UP)¢ªG(SOUND_UP)¢ªH(SOUND_UP)¢ªT°ì»þÄä»ß(SOUND_DOWN)¡õľ¿Ê¢ªT°ì»þÄä»ß(SOUND_DOWN)¡õľ¿Ê¢ªR°ì»þÄä»ß(SOUND_DOWN)¡õº¸ÀÞ¢ªSľ¿Ê(SOUND_UP)¢ªPº¸ÀÞ(SOUND_UP)¢ªE°ì»þÄä»ß(SOUND_DOWN)¡õº¸ÀÞ¢ªAÄä»ß(SOUND_DOWN)
¤¿¤À¤·¡¢
¡¡¡¡¡¤Ê¤ë¤Ù¤¯Â®¤¯Àµ³Î¤Ëư¤¯¥í¥Ü¥Ã¥È¤Ë¤Ê¤ë¤è¤¦¤Ë¹©Éפ¹¤ë¤³¤È¡£
¡¡¡¡¢°ì»þÄä»ß¤Î¸òº¹ÅÀ¤ª¤è¤ÓÃú»úÏ©¤Ç¤ÏSOUND_DOWN¤òÌĤ餷¤¿¸å¡¢1ÉôÖÄä»ß¤¹¤ë¤³¤È¡£
¡¡¡¡£Ä¾³Ñ¥³¡¼¥Ê¡¼¤ª¤è¤Ó°ì»þÄä»ß¤¬ÉÔÍפÏÃú»úÏ©¤Ç¤ÏSOUND_UP¤òÌĤ餷¡¢Ää»ß¤·¤Ê¤¤¤Ç¿Ê¤à¤³¤È
¡£
¡¡¡¡¤¥í¥Ü¥Ã¥È¤Ï¥µ¥¤¥º¤Ï¡¢Éý15cmŤµ18cm°ÊÆâ¤È¤¹¤ë¡Ê¹â¤µ¤Ï̵À©¸Â¡Ë¡£
¡¡¡¡¥¸òº¹ÅÀ¡¢Ãú»úÏ©¡¢Ä¾³Ñ¥³¡¼¥Ê¡¼¤Ë¤Ä¤¤¤Æ¤Ï¡¢º¹¤·³Ý¤«¤Ã¤¿»þÅÀ¤ÇȽÊ̤¹¤ë¤â¤Î¤È¤·¡¢Í½¤áÀßÄꤷ¤¿Áö¹Ô»þ´Ö¤Î¤ß¤ÇȽÄꤷ¤¿¤ê¡¢Áö¹Ôµ÷Î¥¤Î¤ß¤ÇȽÄꤷ¤Æ¤Ï¡¡¡¡¡¡¤Ê¤é¤Ê¤¤¡£
¤È¤¤¤¦¤Î¤¬¾ò·ï¤À¤Ã¤¿¡£
*¥í¥Ü¥Ã¥È¤ÎÀâÌÀ [#tbb73ed0]
Ⱦ·Â¤Î¾®¤µ¤Ê¶ÊÀþ¤â¤Ê¤ë¤Ù¤¯Íưפ˶ʤ¬¤ì¤ë¤è¤¦¤Ë¥â¡¼¥¿¡¼¤Îµ÷Î¥¤òºÇ¾®¸Â¤Ë¤·¤¿¡£¤µ¤é¤Ë¡¢²óž¤äÀû²ó¤Î»þ¤Ë´ù¤È¤ÎË໤¤¬¾®¤µ¤¯¤Ê¤ë¤è¤¦¤Ë¥¿¥¤¥ä¤Ï»°Îؤˤ·¡¢°ì¤Ä¤Ï¥´¥à¤Î¤Ä¤¤¤Æ¤Ê¤¤¤â¤Î¤Ë¤·¤¿¡£¤Þ¤¿¡¢¼Ö¼´¤«¤é¤Î¥»¥ó¥µ¡¼¤ÎÃúÅÙ¤¤¤¤µ÷Î¥¤¬ÁȤßΩ¤Æ¤ë»þÅÀ¤Ç¤Ïʬ¤«¤é¤Ê¤«¤Ã¤¿¤Î¤Ç¡¢¸å¤«¤é¼«Í³¤ËÊѤ¨¤ë¤³¤È¤¬²Äǽ¤Ê¤è¤¦¤ËÁȤßΩ¤Æ¤¿¡£¤½¤ÎÉôʬ¤¬¤â¤í¤¤¤Î¤¬ÆñÅÀ¤À¤Ã¤¿¤¬¡¢µ÷Î¥¤ò´Êñ¤ËÊѤ¨¤é¤ì¤ë¤Î¤Ï·ë²ÌŪ¤Ëºî¶È¤Î¸úΨ¤ò¾å¤²¤¿¡£¼Ö¼´¤ÎÃæ¿´¤È¥»¥ó¥µ¡¼¤Îµ÷Î¥¤Ï¥Ö¥í¥Ã¥¯Æó¸Äʬ¤¬¤Á¤ç¤¦¤É¤è¤«¤Ã¤¿¡£
&ref(2017a/Member/ejj/Mission2/pic_ejj10.JPG,100%,);
&ref(2017a/Member/ejj/Mission2/pic_ejj11.JPG,100%,);
&ref(2017a/Member/ejj/Mission2/pic_ejj12.JPG,100%,);
*¥×¥í¥°¥é¥à¤ÎÀâÌÀ [#af311e06]
**ÄêµÁ [#z17b8dc5]
#define BLACK 39 //¤³¤ì¤è¤ê¾®¤µ¤¤¤È¹õ
#define BLACK_gray 42
#define GRAY 45
#define WHITE_gray 48
#define WHITE 50 //¤³¤ì¤è¤êÂ礤¤¤ÈÇò
#define RIGHT_S OnFwd(OUT_A); OnRev(OUT_C); //±¦Àû²ó
#define LEFT_S OnFwd(OUT_C); OnRev(OUT_A); //º¸Àû²ó
#define RIGHT_K OnFwd(OUT_A); Off(OUT_C); //±¦²óž
#define LEFT_K OnFwd(OUT_C); Off(OUT_A); //º¸²óž
#define GO_FORWARD OnFwd(OUT_AC); //Á°¿Ê£±
#define GO_FORWARD2(t) OnFwd(OUT_AC);Wait(t);Off(OUT_AC);//Á°¿Ê£²
**¥µ¥Ö¥ë¡¼¥Á¥ó [#e1da1893]
¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó£±¡£90Å٤˸ò¤ï¤ë¸òº¹ÅÀ¤òǧ¼±¤·¤Æ²»¡ÊSOUND_UP)¤òÌĤ餹¡£
sub LINE1a()
{
ClearTimer(0);
while(FastTimer(0)<22)
{
if(SENSOR_2>=WHITE){RIGHT_S;ClearTimer(0);}
else if(SENSOR_2>=WHITE_gray){RIGHT_K;ClearTimer(0);}
else if(SENSOR_2>=GRAY){GO_FORWARD;ClearTimer(0);}
else if(SENSOR_2>=BLACK_gray){LEFT_K;ClearTimer(0);}
else{LEFT_S;}
}
Off (OUT_AC);
PlaySound(SOUND_UP);
}
¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó£²¡£90Åٰʾå¤Î³ÑÅ٤Ǹò¤ï¤ë¸òº¹ÅÀ¤òǧ¼±¤·¤Æ²»¡ÊSOUND_UP)¤òÌĤ餹¡£
sub LINE1b()
{
ClearTimer(0);
while(FastTimer(0)<19)
{
if(SENSOR_2>=WHITE){RIGHT_S;ClearTimer(0);}
else if(SENSOR_2>=WHITE_gray){RIGHT_K;ClearTimer(0);}
else if(SENSOR_2>=GRAY){GO_FORWARD;ClearTimer(0);}
else if(SENSOR_2>=BLACK_gray){LEFT_K;ClearTimer(0);}
else{LEFT_S;}
}
Off (OUT_AC);
PlaySound(SOUND_UP);
}
¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó£³¡£²»¤òÌĤ餵¤º¤Ë¼¡¤Î¥×¥í¥°¥é¥à¤Ë¿Ê¤à¡£
sub LINE1c()
{
ClearTimer(0);
while(FastTimer(0)<22)
{
if(SENSOR_2>=WHITE){RIGHT_S;ClearTimer(0);}
else if(SENSOR_2>=WHITE_gray){RIGHT_K;ClearTimer(0);}
else if(SENSOR_2>=GRAY){GO_FORWARD;ClearTimer(0);}
else if(SENSOR_2>=BLACK_gray){LEFT_K;ClearTimer(0);}
else{LEFT_S;}
}
}
¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó£´¡£¸òº¹ÅÀ¤òǧ¼±¤·¤Æ²»¡ÊSOUND_DOWN¡Ë¤òÌĤ餷¤¿¸å¡¢1ÉÃÄä»ß¤¹¤ë¡£
sub LINE2()
{
ClearTimer(0);
while(FastTimer(0)<22)
{
if(SENSOR_2>=WHITE){RIGHT_S;ClearTimer(0);}
else if(SENSOR_2>=WHITE_gray){RIGHT_K;ClearTimer(0);}
else if(SENSOR_2>=GRAY){GO_FORWARD;ClearTimer(0);}
else if(SENSOR_2>=BLACK_gray){LEFT_K;ClearTimer(0);}
else{LEFT_S;}
}
Off (OUT_AC);
PlaySound(SOUND_DOWN);
Wait(100);
}
0.8Éú¸Àû²ó¤¹¤ë¥µ¥Ö¥ë¡¼¥Á¥ó¡£
sub CROSS_LEFT1()
{
while(FastTimer(0) < 80) {
LEFT_S;
}
ClearTimer(0);
}
2.2Éú¸²óž¤¹¤ë¥µ¥Ö¥ë¡¼¥Á¥ó¡£
sub CROSS_LEFT2()
{
while(FastTimer(0) < 220) {
LEFT_K;
}
ClearTimer(0);
}
1.2Éú¸²óž¤¹¤ë¥µ¥Ö¥ë¡¼¥Á¥ó¡£
sub CROSS_LEFT3()
{
while(FastTimer(0) < 120) {
LEFT_K;
}
ClearTimer(0);
}
0.8Éñ¦²óž¤¹¤ë¥µ¥Ö¥ë¡¼¥Á¥ó¡£
sub CROSS_RIGHT()
{
while(FastTimer(0) < 80) {
RIGHT_K;
}
ClearTimer(0);
}
**¥¿¥¹¥¯¥á¥¤¥ó [#p3728ba6]
task main()
{
SetSensor(SENSOR_2,SENSOR_LIGHT);
LINE1a(); //F¤Þ¤Ç
CROSS_LEFT1();
LINE2(); //Q¤Þ¤Ç
CROSS_LEFT2();
LINE1b(); //R¤Þ¤Ç
CROSS_RIGHT();
LINE1b(); //S¤Þ¤Ç
CROSS_LEFT3();
LINE1a(); //G¤Þ¤Ç
CROSS_LEFT3();
LINE1c();
CROSS_LEFT1();
LINE1c();
CROSS_LEFT1();
LINE1c();
CROSS_LEFT1();
LINE1a(); //H¤Þ¤Ç
CROSS_LEFT2();
LINE2(); //T¡Ê°ì²óÌܡˤޤÇ
GO_FORWARD2(30);
LINE2(); //T¡ÊÆó²óÌܡˤޤÇ
GO_FORWARD2(30);
LINE2(); //R¤Þ¤Ç
CROSS_LEFT2();
LINE1b(); //S¤Þ¤Ç
CROSS_RIGHT();
LINE1b(); //P¤Þ¤Ç
CROSS_LEFT3();
LINE2(); //E¤Þ¤Ç
CROSS_LEFT3();
LINE2(); //¥´¡¼¥ë
}
*¤Þ¤È¤á[#r040aa97]
**´¶ÁÛ [#pb79b8c0]
º£²ó¤Î²ÝÂê¤ÏÁ°²ó¤È¤Ï°ã¤¤¡¢¥í¥Ü¥Ã¥È¤ÏÈó¾ï¤Ë¥¹¥à¡¼¥º¤ËºîÀ®¤Ç¤¤¿¡£¤À¤¬¥×¥í¥°¥é¥à¤ÎÊý¤Ï¤È¤Æ¤âÊ£»¨¤À¤Ã¤¿¡£¥»¥ó¥µ¡¼¤ÎÃͤϾ¯¤·°ã¤¦¤À¤±¤Ç¤â¥í¥Ü¥Ã¥È¤¬Á´¤¯°ã¤¦Æ°¤¤ò¤¹¤ë¤Î¤Ç¡¢¤½¤Î»þ¤Ë¥»¥ó¥µ¡¼¤ÎÃͤ¬¤ª¤«¤·¤¤¤Î¤«¥×¥í¥°¥é¥à¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¤Î¤«¤ï¤«¤é¤º¶ìÏ«¤·¤¿¡£¤Þ¤¿¡¢¥í¥Ü¥Ã¥È¤¬¸òº¹ÅÀ¤ò¶Ê¤¬¤ë»þ¡¢Æ»¤¬¸ò¤ï¤ë³ÑÅÙ¤¬°ã¤¤¡¢¤Ê¤«¤Ê¤«¤¦¤Þ¤¯¤¤¤«¤Ê¤«¤Ã¤¿¡£Àþ¤ò¤¿¤É¤ë¥í¥Ü¥Ã¥È¤Èʹ¤¤¤¿¤é´Êñ¤½¤¦¤Ëʹ¤³¤¨¤ë¤±¤ì¤É¡¢ÁÛÁü°Ê¾å¤Ë»þ´Ö¤¬¤«¤«¤Ã¤¿¡£
**È¿¾Ê [#zbfaba39]
¤³¤Î¥í¥Ü¥Ã¥È¤ÏÉÔ´°Á´¤Ç¥´¡¼¥ë¤Þ¤Ç¤¿¤É¤êÃ失¤Ê¤¤»þ¤â¤¿¤Þ¤Ë¤¢¤ë¡£¤½¤ì¤Ï¥¹¥¿¡¼¥È¤Î»þ¤ÎÀþ¤È¥»¥ó¥µ¡¼¤Î°ÌÃÖ´Ø·¸¤ä¥í¥Ü¥Ã¥È¤òÃÖ¤¯³ÑÅ٤ˤè¤ë¤È¹Í¤¨¤é¤ì¤ë¡£¤Þ¤¿¡¢µÞÀû²ó¤ÎÉôʬ¤Ï¿Ê¤á¤ë¤è¤¦¤Ë¤Ï¤Ê¤Ã¤¿¤¬¡¢¥×¥í¥°¥é¥à¤Ï¤â¤Ã¤È¥·¥ó¥×¥ë¤Ë¤Ç¤¤½¤¦¤Ç¤â¤¢¤ë¡£ºÇ¸å¤Î²ÝÂê¤Ç¤Ï¾¯¤·¤Ç¤â´°àú¤Ë¶á¤Å¤±¤é¤ì¤ë¤è¤¦¤ËºÇ¸å¤Þ¤Ç¤ä¤ê¤¤ê¤¿¤¤¡£
¥Ú¡¼¥¸Ì¾: