2019a/Member/Gouki/Mission3
¤ò¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤·¤ÆºîÀ®
[
¥È¥Ã¥×
] [
¿·µ¬
|
°ìÍ÷
|
¸¡º÷
|
ºÇ½ª¹¹¿·
|
¥Ø¥ë¥×
|
¥í¥°¥¤¥ó
]
³«»Ï¹Ô:
Ìܼ¡
#contents
*²ÝÂê¤Ë¤Ä¤¤¤Æ [#z31d1a0c]
**²ÝÂê¤Î¾ÜºÙ [#j3756556]
¥Ü¡¼¥ë¤ò±¿¤Ö¤¿¤á¤Î¥í¥Ü¥Ã¥È¤òºîÀ®¤·¡¢¥Ü¡¼¥ë¤ò±¿È¤·¤Æ½êÄê¤ÎÍÆ´ï¤ÎÃæ¤ËÆþ¤ì¤ë¡£
#ref(2019a/Member/Gouki/Mission3/map3.png,100%);
**¥Õ¥£¡¼¥ë¥É¤ÎÀâÌÀ [#x07bc6d6]
-¥Õ¥£¡¼¥ë¥É¤Ï²ÝÂê2¤Ç»ÈÍѤ·¤¿»æ¤ò»ÈÍѤ¹¤ë¡£
-À¸¶¨¤Î¤ªÊÛÅö¤Î»Í³Ñ¤¤¥×¥éÍÆ´ï2¤Ä¤ò¤½¤ì¤¾¤ì±ßÆâ¤ËÃÖ¤¡¢ÊÒÊý¤Ë¶Ì¤ò2¸ÄÆþ¤ì¤ë¡£
-»Ä¤ê¤Î2¸Ä¤Î¶Ì¤Ï²ÝÂê2¤ÈƱ¤¸°ÌÃÖ¤ËÃÖ¤¯¡£¤½¤ÎºÝ¡¢¥´¥à¥¿¥¤¥ä¤ä¥×¥ì¡¼¥È¤Î¾å¤ËÃÖ¤¤¤Æ¤â¤è¤¤¡£
-¥×¥éÍÆ´ï¤Ë¤Ï¿§¤ò¤Ä¤±¤¿¤êʸ»ú¤äµ¹æ¤ò½ñ¤¤¤Æ¤â¤è¤¤¡£
-¥×¥éÍÆ´ï¤ÏξÌ̥ơ¼¥×Åù¤Ç¥Õ¥£¡¼¥ë¥É¤Ë¸ÇÄꤷ¤Æ¤â¤è¤¤¡£
-2Ëç¤Î»æ¤Î¶³¦¤Ë¤Ï¤½¤ì¤¾¤ìÉý1cm¡¢¹ç·×2cm¤Î¹õÀþ¤òÉÁ¤¤¤Æ¤â¤è¤¤¡£
**´ðËܥ롼¥ë [#w587e337]
-¶¥µ»»þ´Ö¤Ï¿³È½¤¬Â³¹ÔÉÔǽ¤ÈȽÃǤ¹¤ë¤Þ¤Ç¡¢¤¢¤ë¤¤¤Ï¥ê¥¿¥¤¥¢¤¹¤ë¤Þ¤Ç¡£
-¿Þ¤ÎAÃÏÅÀ¤Þ¤¿¤Ï¡Ê¤ª¤è¤Ó¡ËA'ÃÏÅÀ¤«¤é¥¹¥¿¡¼¥È¤¹¤ë¡£¤¿¤À¤·ÀÜÃϤ·¤Æ¤¤¤ëÉôʬ¤Ï¤½¤ì¤¾¤ì¤ÎÎΰè-Æâ¤Ë¼ý¤Þ¤ë¤â¤Î¤È¤¹¤ë¡ÊÀþ¾å¤ÏOK¡Ë¡£¾å¶õÉôʬ¤ÏÎΰ褫¤é¤Ï¤ß½Ð¤·¤Æ¤¤¤Æ¤â¤è¤¤¡£
-³«»Ï¤Î¹ç¿Þ¤«¤é£µÉÃ°ÊÆâ¤Ë¥¹¥¿¡¼¥È¥Ü¥¿¥ó¤ò²¡¤¹ºî¶È¤ò´°Î»¤¹¤ë¤³¤È¡£
-¶¥µ»¤¬½ªÎ»¤¹¤ë¤Þ¤Ç¡¢¥í¥Ü¥Ã¥È¤Ë¿¨¤Ã¤¿¤ê¿Í´Ö¤¬±ó³Ö¤ÇÁàºî¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
-ÅÓÃæ¤Ç¤¦¤Þ¤¯Æ°¤«¤Ê¤¯¤Ê¤Ã¤¿¾ì¹ç¡¢£±²ó¸Â¤êºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡ÊºÆ¥¹¥¿¡¼¥È¤ÎºÝ¤ËÊÌ¥×¥í¥°¥é¥à¤Çµ¯Æ°¤·¤Æ¤è¤¤¡Ë¡£
-¶¥µ»½ªÎ»¸å¡¢¥í¥Ü¥Ã¥È¤¬¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤Ë¿¨¤ì¤Æ¤¤¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
-¶¥µ»½ªÎ»¸å¡¢¤â¤È¤â¤È¶Ì¤¬Æþ¤Ã¤Æ¤¤¤¿¥×¥éÍÆ´ï¤¬¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤Ë¿¨¤ì¤Æ¤¤¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
**´ðËÜÆÃŵ¤Î·×»»ÊýË¡ [#v3e9c93a]
-¥×¥éÍÆ´ïÆâ¤Î¶Ì¤ò1¸Ä±¿¤Ù¤Ð8ÅÀ¡£Æó¤Ä¤È¤â±¿¤Ù¤Ð20ÅÀ¡£
-LÃÏÅÀ¤ÈL'ÃÏÅÀ¤Î¶Ì¤ò¤É¤Á¤é¤«1¸Ä±¿¤Ù¤Ð4ÅÀ¡¢2¸Ä¤È¤â±¿¤Ù¤Ð12ÅÀ¡£
-¶¥µ»½ªÎ»¸å¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤¬´°Á´¤Ë±ß¤«¤é½Ð¤·¤Þ¤Ã¤¿¾ì¹ç¡¢¤â¤È¤Î´ðËÜÅÀ¤Î1/4¤ò¸ºÅÀ¡£
-¶¥µ»½ªÎ»¸å¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤ÎȾʬ°Ê¾å¤¬±ß¤«¤é½Ð¤Æ¤¤¤ì¤Ð¡¢¤â¤È¤Î´ðËÜÅÀ¤Î3/4¤ò¸ºÅÀ¡£
-¶¥µ»½ªÎ»¸å¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤Ë¤â¤È¤Î¥×¥éÍÆ´ï¤¬¿¨¤ì¤Æ¤¤¤ì¤Ð¡¢¤â¤È¤Î´ðËÜÅÀ¤Î1/2¤ò¸ºÅÀ¡£
-¶¥µ»½ªÎ»¸å¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤Ë¤â¤È¤Î¥×¥éÍÆ´ï¤¬¿¨¤ì¤Æ¤¤¤ì¤Ð¡¢¤â¤È¤Î´ðËÜÅÀ¤Î1/2¤ò¸ºÅÀ¡£
-¶¥µ»½ªÎ»¸å¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤Ë¥í¥Ü¥Ã¥È¤¬¿¨¤ì¤Æ¤¤¤ì¤Ð¡¢¤â¤È¤Î´ðËÜÅÀ¤Î1/4¤ò¸ºÅÀ¡£
**µ»½ÑŸ¤Î·×»»ÊýË¡ [#t74989b1]
°Ê²¼¤Îưºî¤ÎÀºÅÙ¡¦¥¹¥Ô¡¼¥É¡¦³Î¼ÂÀ¤Ê¤É¤ò´Þ¤á¤¿µ»½ÑŪ¤Ê¹©Éפä·Ý½ÑÀ¤Ë¤Ä¤¤¤ÆÂ¾¤ÎÁ´¤Æ¤Î¥Á¡¼¥à(5¥Á¡¼¥à)¤¬20ÅÀËþÅÀ¤ÇºÎÅÀ¤·¡¢¤½¤ÎÊ¿¶ÑÅÀ¤òµá¤á¤ë¡£ ÆÀÅÀ¤ÎÌܰ¡§
-¶Ì¤òõ¤·¼è¤ê¤Ë¤¤¤¯¤Þ¤Ç¤Îưºî (3ÅÀ)
-¶Ì¤òÄÏ¤àÆ°ºî (3ÅÀ)
-¶Ì¤ò¤ò±¿¤Öưºî (2ÅÀ)
-¶Ì¤òÍÆ´ï¤ÎÃæ¤ËÆþ¤ì¤ëưºî (2ÅÀ)
-2Âæ¤ÎRIS¡¢NXT¡¢EV3¤ÎÏ¢·È¤ÎÎɤµ(2ÅÀ)
-¼«Î©·¿¤Î¥í¥Ü¥Ã¥È¤È¤·¤Æ¤Î·Á¤äưºî¤ÎÈþ¤·¤µ¡¢»Â¿·¤µ(2ÅÀ)
-¤½¤Î¾ (3ÅÀ)
*¥í¥Ü¥Ã¥È¤Ë¤Ä¤¤¤Æ [#dc407bb5]
»ä¤¿¤Á¤Î¥í¥Ü¥Ã¥È¤Ï¥Ü¡¼¥ë¤ò°ì¤Ä¤º¤Ä±¿È½ÐÍè¤ë¤è¤¦¤Ê¥í¥Ü¥Ã¥È¤òºîÀ®¤·¤Þ¤·¤¿¡£~
¤½¤Î¤¿¤á¤¤Á¤ó¤È¾®²ó¤ê¤¬¤¤¯¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ë¡¢¥³¥ó¥Ñ¥¯¥È¤Ê·Á¤Ë»Å¾å¤²¤·¤Þ¤·¤¿¡£
#ref(2019a/Member/Gouki/Mission3/¤ß¤Ã¤·¤è¤ó3_190814_0005.jpg,15%);
#ref(2019a/Member/Gouki/Mission3/¤ß¤Ã¤·¤è¤ó3_190814_0004.jpg,15%);
#ref(2019a/Member/Gouki/Mission3/¤ß¤Ã¤·¤è¤ó3_190814_0003.jpg,15%);
**ËÜÂÎÉôʬ [#rfb9cbf5]
¤Ê¤ë¤Ù¤¯¾®¤µ¤¯¥³¥ó¥Ñ¥¯¥È¤Ëºî¤Ã¤¿¡£ËÜÂΤòÇØÌ̤¢¤ï¤»¤Ë¤·¡¢ÌµÂ̤ʶõ´Ö¤ò̵¤¯¤·¤¿¡£~
¥»¥ó¥µ¡¼¤Ï¼ÖÎØ¤Ë¶á¤Å¤±¡¢¤¤Á¤ó¤È¾®²ó¤ê¤¬²Äǽ¤Ê¥»¥ó¥µ¡¼¸¡ÃΤò½ÐÍè¤ë¤è¤¦¤Ë¤·¤¿¡£
#ref(2019a/Member/Gouki/Mission3/asimawari.jpg,30%);
**¥¢¡¼¥àÉôʬ [#n6f8d1c4]
¥¢¡¼¥à¤ÎÉôʬ¤âËÜÂÎÆ±ÍÍ¥·¥ó¥×¥ë¤Ë¤·¡¢¥â¡¼¥¿¡¼¤ËľÀÜÉôÉʤò¤Ä¤±¡¢²óž¤µ¤»¥¢¡¼¥à¤òư¤«¤·¡¢~
¥Ü¡¼¥ë¤ò¤Ä¤«¤ó¤À¤êÎ¥¤·¤¿¤ê½ÐÍè¤ë¤è¤¦¤Ê¥¯¥ì¡¼¥ó·¿¤Î¥¢¡¼¥à¤ËÍî¤ÁÃ夤¤¿¡£
#ref(2019a/Member/Gouki/Mission3/Inked¤ß¤Ã¤·¤è¤ó3_190814_0002_LI.jpg,15%);
#ref(2019a/Member/Gouki/Mission3/Inked¤ß¤Ã¤·¤è¤ó3_190814_0001_LI.jpg,15%);
#ref(2019a/Member/Gouki/Mission3/Inked¤ß¤Ã¤·¤è¤ó3_190814_00021_LI.jpg,15%);
¥¢¡¼¥à¤ò°ìÈÖ¾å¤Þ¤Ç¾å¤²¤ë¤¿¤á¤Ë¡¢Êä½õ¤È¤·¤ÆÎØ¥´¥à¤ò»È¤Ã¤¿¡£
#ref(2019a/Member/Gouki/Mission3/Inked¤ß¤Ã¤·¤è¤ó3_190814_0005_LI.jpg,15%);
*ºîÀï [#z667c8b6]
**¥ë¡¼¥È¤Ë¤Ä¤¤¤Æ [#i3296f07]
»ä¤¿¤Á¤Ï¥Ü¡¼¥ë¤ò°ì¤Ä¤º¤Ä±¿È¤¹¤ë¥í¥Ü¥Ã¥È¤òºî¤Ã¤¿¤¿¤á¡¢¥Ü¡¼¥ë¤ò¤Ä¤«¤ß~
¥È¥ì¡¼¤Ë»ý¤Ã¤Æ¤¤¤¡¢¥Ü¡¼¥ë¤òÎ¥¤¹¤È¤¤¤¦¹Ôư¤ò¹ç·×£´²ó¹Ô¤¦É¬Íפ¬¤¢¤ë¡£
¤½¤Î¤¿¤á¼¡¤Î¤è¤¦¤Ê¥ë¡¼¥È¤Ç¥í¥Ü¥Ã¥È¤òư¤«¤¹¤³¤È¤Ë¤·¤¿¡£
#ref(2019a/Member/Gouki/Mission3/¤ß¤Ã¤·¤è¤ó3_190814_0007.jpg,50%);
¡A'¤ò½Ðȯ¤·L'¤Î¥Ü¡¼¥ë¤òÄϤߡ¤Àû²ó¤·¤ÆÍÆ´ï¤ËÆþ¤ì¤ë¡¥
#ref(2019a/Member/Gouki/Mission3/route1.png,50%);
¢¼¡¤Ë¡¤¤½¤³¤«¤éľÀþ¤òÆÍ¤ÃÀڤäÆÍÆ´ï¤ÎÃæ¤Î¥Ô¥ó¥Ý¥ó¶Ì¤òÄϤߥ´¡¼¥ë¤Ë¤¢¤ëÍÆ´ï¤ËÆþ¤ìÂØ¤¨¤ë¡¥
#ref(2019a/Member/Gouki/Mission3/route2.png,50%);
£Æ±¤¸¤¯ÍÆ´ï¤ÎÃæ¤Î¥Ü¡¼¥ë¤ò¥´¡¼¥ë¤ÎÍÆ´ï¤Ë»ý¤Ã¤Æ¤¤¤Æþ¤ì¤ë¡¥
#ref(2019a/Member/Gouki/Mission3/route3.png,50%);
¤ºÇ¸å¤Ë¡¤L¤Ë¤¢¤ë¥Ü¡¼¥ë¤òÄϤߥ´¡¼¥ë¤ÎÍÆ´ï¤ËÆþ¤ì¤ë
#ref(2019a/Member/Gouki/Mission3/route4.png,50%);
*¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ [#h6c4ad2e]
º£²ó¤ÏËÜÂΤò£²µ¡»È¤¤¡¢
-¥Þ¥¹¥¿¡¼¡§Î¾¼ÖÎØ¡¢¥¢¡¼¥à¤Î¾å¤²²¼¤²
-¥¹¥ì¡¼¥Ö¡§¥Ü¡¼¥ë¤ò¤Ä¤«¤àưºî
¤È¤¤¤¦¤è¤¦¤Ëưºî¤òʬ¤±¤Æ¡¢¥×¥í¥°¥é¥ß¥ó¥°¤òºî¤Ã¤¿¡£
**¶¦ÄÌ¤Î¥×¥í¥°¥é¥à [#n4cc6b0d]
2µ¡´Ö¤ÇÄÌ¿®¤¹¤ë¤¿¤á¤Ë°Ê²¼¤Î¥Þ¥¯¥í¤òÄêµÁ¤·¤¿¡£
#define SIGNALON1 11
#define SIGNALOFF1 12
#define SIGNALON2 13
#define SIGNALOFF2 14
**¥¢¡¼¥à¤Î¥×¥í¥°¥é¥à(¥¹¥ì¡¼¥Ö¦¤Î¥×¥í¥°¥é¥à) [#ife08613]
***¥¢¡¼¥à¤Î¾å¤²²¼¤²¤Î¥Þ¥¯¥í [#yfbde368]
#define arm_down OnFwd(OUT_A,25);Wait(1500);Off(OUT_A); //¥¢¡¼¥à¤ò²¼¤²¤ë
#define arm_up OnRev(OUT_A,35);Wait(1500);Off(OUT_A); //¥¢¡¼¥à¤ò¾å¤²¤ë
***¥¹¥ì¡¼¥Ö¤Î¥×¥í¥°¥é¥à [#x33fd690]
#define SIGNALON1 11
#define SIGNALOFF1 12
#define SIGNALON2 13
#define SIGNALOFF2 14
#define CONN 1 //¥Þ¥¹¥¿¡¼¤ÎÀܳÈÖ¹æ
task main()
{
int msg; //¼õ¤±¼è¤Ã¤¿Ãͤò³ÊǼ¤¹¤ëÊÑ¿ô
while(true){
ReceiveRemoteNumber(MAILBOX1,true,msg); //MAILBOX1¤ÎÃͤò¼õ¤±¼è¤êmsg¤Ë³ÊǼ
if(msg==SIGNALON1){¡¡¡¡¡¡¡¡¡¡¡¡¡¡//SIGNALON1¤ò¼õ¿®¤·¤¿¤È¤
OnRev(OUT_A,20);Wait(1000);¡¡//¥Ü¡¼¥ë¤òÄϤà
}else if(msg==SIGNALOFF1){¡¡¡¡¡¡ //SIGNALOFF1¤ò¼õ¿®¤·¤¿¤È¤
Off(OUT_A);¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¥â¡¼¥¿A¤ò»ß¤á¤ë
}else if(msg==SIGNALON2){¡¡¡¡¡¡¡¡//SIGNALON2¤ò¼õ¿®¤·¤¿¤È¤
OnFwd(OUT_A,20);Wait(1000);¡¡//¥Ü¡¼¥ë¤òÊü¤¹
}else if(msg==SIGNALOFF2){¡¡¡¡¡¡ //SIGNALOFF2¤ò¼õ¿®¤·¤¿¤È¤
Off(OUT_A);¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¥â¡¼¥¿A¤ò»ß¤á¤ë
}
}
}
**¥é¥¤¥ó¥È¥ì¡¼¥¹ [#zd28da58]
***¥Þ¥¯¥í [#h278ba8e]
»ä¤¿¤Á¤Ï¡Ö´°Á´¤Ë¿¿¤ÃÇò¡×¡¢¡ÖÇò¤È¶Ìܤδ֡ס¢¡Ö¶Ìܡס¢¡Ö¹õ¤È¶Ìܤδ֡ס¢~
¡Ö´°Á´¤Ë¹õ¡×¤Î£µ¤Ä¤ÎÉôʬ¤Ë¿§¤òʬ¤±¤ÆÂ¬¤Ã¤¿¡£~
¸÷¥»¥ó¥µ¡¼¤Ç¸¡ÃΤ¹¤ë¿ôÃͤò°Ê²¼¤Î¥Þ¥¯¥í¤ÇÄêµÁ¤·¤¿¡£
#define black 30
#define white 60
#define lightgray 50
#define darkgray 39
#define center 45
#ref(2019a/Member/Gouki/Mission3/light_sennser.png,15%);
¤½¤Î¾ÍÍ¡¹¤Êưºî¤ò°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤·¤¿¡£
#define turn_right OnFwd(OUT_C,25);OnRev(OUT_B,23); //±¦ÀÞ
#define turn_left OnFwd(OUT_B,28);OnRev(OUT_C,20); //º¸ÀÞ
#define rotate_right OnFwd(OUT_C,25);OnRev(OUT_B,22); //±¦Àû²ó
#define rotate_left OnFwd(OUT_B,28);OnRev(OUT_C,15); //º¸Àû²ó
#define go_straight OnFwd(OUT_B,23);OnFwd(OUT_C,20); //ľ¿Ê
#define go_straight2 OnFwd(OUT_B,20);OnFwd(OUT_C,17); //K'¤«¤éL'¤Ç¤Î½ÐÎϼå¤á¤Îľ¿Ê
#define turn OnRev(OUT_C,20);OnFwd(OUT_B,28);Wait(3200);Off(OUT_BC); //L'¤Î¥Ü¡¼¥ëÄϤó¤Ç ¤«¤éÆþ¤ì¤ë¤Þ¤Ç¤ÎÀû²ó
#define turn2 OnRev(OUT_B,28);OnFwd(OUT_C,20);Wait(1500);Off(OUT_BC); //¥Ü¡¼¥ë¤ÎÆþ¤Ã¤Æ¤ë¥È¥ì¡¼¤Ø¤Î¤ï¤º¤«¤ÊÄ´À°
#define sakittyo OnFwd(OUT_C,20);OnFwd(OUT_B,23);Wait(1150);Off(OUT_BC); //¥Ü¡¼¥ë¤¬Æþ¤Ã¤Æ¤ë¥È¥ì¡¼Á°¤Ç¤Î¤ï¤º¤«¤ÊÁ°¿Ê
#define turn3 OnRev(OUT_B,30);Wait(4800);Off(OUT_BC); //¥È¥ì¡¼¤Î¥Ü¡¼¥ë¤òÄϤó¤À¸å¤ÎÊý¸þž´¹
#define turn4 OnRev(OUT_B,30);Wait(5200);Off(OUT_BC); //
#define back OnRev(OUT_C,20);OnRev(OUT_B,28);Wait(3000);Off(OUT_BC); //ºÇ¸å¥È¥ì¡¼¤Ë¿¨¤ì¤Ê¤¤¤è¤¦¤Ë¾¯¤·Î¥¤ì¤ë
***º¸Â¦¤Î¥é¥¤¥ó¥È¥ì¡¼¥¹ [#a05ab4c7]
sub followline_L(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){ //¸½ºß¤Î»þ¹ï¤¬°ìÄê¤ÎÃͤòͤ¨¤ë¤Þ¤Ç
if(SENSOR_1<black){ //¥»¥ó¥µ¡¼¤¬¹õ¤Î»þ
rotate_left; //º¸Àû²ó
}else if(SENSOR_1<darkgray){ //¥»¥ó¥µ¡¼¤¬¹õ³¥¤Ê¤é
turn_left; //º¸ÀÞ
}else if(SENSOR_1>lightgray){ //¥»¥ó¥µ¡¼¤¬Çò³¥¤Ê¤é
turn_right; //±¦ÀÞ
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else if(SENSOR_1<center){ //ÌÀ¤ë¤µ45°Ê²¼¤Ç
go_straight; //ľ¿Ê
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else{ //¤½¤ì°Ê³°¤Ï
rotate_right; //±¦Àû²ó
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}
}
Off(OUT_BC); //»þ¹ï¤¬°ìÄê¤ÎÃͤòͤ¨¤ë¤ÈÄä»ß
Wait(1000); //1ÉôÖÄä»ß
}
***±¦Â¦¤Î¥é¥¤¥ó¥È¥ì¡¼¥¹ [#qa9b1ed2]
sub followline_R(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){ //¸½ºß¤Î»þ¹ï¤¬°ìÄê¤ÎÃͤòͤ¨¤ë¤Þ¤Ç
if(SENSOR_1<black){ //¥»¥ó¥µ¡¼¤¬¹õ¤Î»þ
rotate_right; //±¦Àû²ó
}else if(SENSOR_1<darkgray){ //¥»¥ó¥µ¡¼¤¬¹õ³¥¤Ê¤é
turn_right; //±¦ÀÞ
}else if(SENSOR_1>lightgray){ //¥»¥ó¥µ¡¼¤¬Çò³¥¤Ê¤é
turn_left; //º¸ÀÞ
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else if(SENSOR_1<center){ //¥»¥ó¥µ¡¼¤¬45°Ê²¼¤Ê¤é
go_straight; //ľ¿Ê
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else{ //¤½¤ì°Ê³°¤Ï
rotate_left; //º¸Àû²ó
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}
}
Off(OUT_BC); //°ìÄê¤Î»þ´Ö¤òͤ¨¤ë¤ÈÄä»ß
Wait(1000); //°ìÉôÖÄä»ß
}
Ëô¡¢K,L´Ö¡¢K`,L`´Ö¤Ç¤Ï¤½¤Î¤Þ¤Þ¤Î½ÐÎϤÇľ¿Ê¤·¤Æ¤·¤Þ¤¦¤È¥Ü¡¼¥ë¤Ë¿¨¤ì¤¿ºÝ¤Ë~
¥Ü¡¼¥ë¤òÈô¤Ð¤·¤Æ¤·¤Þ¤¦²ÄǽÀ¤¬¤¢¤ë¤¿¤á¡¢¤³¤ÎÉôʬ¤À¤±Ä¾¿Ê¤Î½ÐÎϤ¬¼å¤¯¤Ê¤ë¤è¤¦¤Ê~
±¦Â¦¥é¥¤¥ó¥È¥ì¡¼¥¹¤Ë¤·¤¿¡£¤½¤ì¤¬²¼µ¤Î¥×¥í¥°¥é¥à¤Ç¤¢¤ë¡£
sub followline_R2(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){ //»þ¹ï¤¬¤¢¤ë°ìÄê¤ÎÃͤè¤ê¾®¤µ¤¤¤È¤
if(SENSOR_1<black){ //¹õ¤Ê¤é
rotate_right; //±¦Àû²ó
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else if(SENSOR_1<darkgray){ //³¥¹õ¿§¤Ê¤é
turn_right; //±¦ÀÞ
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else if(SENSOR_1>lightgray){ //³¥Çò¿§¤Ê¤é
turn_left; //º¸ÀÞ
}else if(SENSOR_1<center){ //ÌÀ¤ë¤µ45°Ê²¼¤Ç
go_straight2; //¤æ¤Ã¤¯¤êľ¿Ê
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else{ //¤½¤ì°Ê³°¤Ê¤é
rotate_left; //º¸Àû²ó
}
}
Off(OUT_BC); //Ää»ß
Wait(2000); //2ÉôÖÄä»ß
}
***²£ÃÇ [#d41cbe46]
Æó¤Ä¤Î¥Þ¥Ã¥×¤ò²£ÃǤ¹¤ëºÝ¡¢¹õ¤ò¸«¤Ä¤±¤ë¤Þ¤Çľ¿Ê¤¹¤ë¥×¥í¥°¥é¥à¤ÈÇò¤ò¸«¤Ä¤±¤ë¤Þ¤Çľ¿Ê¤¹¤ë~
¥×¥í¥°¥é¥à¤ò¸ò¸ß¤ËÁȤ߹ç¤ï¤»¤Æ²£ÃǤ¹¤ë
-¹õ¤ò¸«¤Ä¤±¤ë¤Þ¤Çľ¿Ê
sub Blackto_White()
{
while(SENSOR_1<lightgray){¡¡//¸÷¥»¥ó¥µ¡¼¤ÎÃͤ¬Çò³¥¤è¤ê¾®¤µ¤¤¤È¤
OnFwd(OUT_C,25);¡¡¡¡¡¡¡¡¡¡¡¡
OnFwd(OUT_B,25);¡¡¡¡¡¡¡¡¡¡¡¡//ľ¿Ê
}
Off(OUT_BC);¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//Çò³¥¤è¤êÂ礤¯¤Ê¤ë¤È»ß¤Þ¤ë
}
-Çò¤ò¸«¤Ä¤±¤ë¤Þ¤Çľ¿Ê
sub Whiteto_Black()
{
while(SENSOR_1>darkgray){¡¡//¸÷¥»¥ó¥µ¡¼¤ÎÃͤ¬¹õ³¥¤è¤ê¤âÂ礤¤¤È¤
OnFwd(OUT_C,25);¡¡¡¡¡¡¡¡¡¡
OnFwd(OUT_B,25); //ľ¿Ê
}
Off(OUT_BC); //¹õ³¥¤è¤ê¤âÂ礤¯¤Ê¤ë¤È»ß¤Þ¤ë
}
Ëô¡¢¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î±¦Â¦¤Èº¸Â¦¤òÆþ¤ìÂØ¤¨¤ë»þ¤Ë»È¤¦²£ÃÇ¤Î¥×¥í¥°¥é¥à¤¬¤¢¤ë¡£
-¹õ¤ò¸«¤Ä¤±¤ë¤Þ¤Ç±¦Àû²ó
sub Whiteto_Black_R()
{
while(SENSOR_1>darkgray){¡¡//¸÷¥»¥ó¥µ¡¼¤ÎÃͤ¬¹õ³¥¤è¤ê¤âÂ礤¤¤È¤
OnFwd(OUT_C,25);¡¡¡¡¡¡¡¡¡¡
OnRev(OUT_B,25); //±¦Àû²ó
}
Off(OUT_BC); //¹õ³¥¤è¤ê¤â¾®¤µ¤¯¤Ê¤ë¤È»ß¤Þ¤ë
}
-¹õ¤ò¸«¤Ä¤±¤ë¤Þ¤Çº¸Àû²ó
sub Whiteto_Black_L()
{
while(SENSOR_1>black){¡¡//¸÷¥»¥ó¥µ¡¼¤ÎÃͤ¬¹õ¤è¤êÂ礤¤¤È¤
OnFwd(OUT_B,25);
OnRev(OUT_C,25); //º¸Àû²ó
}
Off(OUT_BC); //¹õ¤è¤ê¾®¤µ¤¤¤È¤
}
**¥Þ¥¹¥¿¡¼¤Î¥×¥í¥°¥é¥à [#g32bc84d]
task main()
{
SetSensorLight(S1); //ü»Ò£±¤Ë¸÷¥»¥ó¥µ¡¼
RemoteStartProgram(CONN,"kodomo.nxc");¡¡¡¡//¥¹¥ì¡¼¥Ö¤Î¥×¥í¥°¥é¥à¤òµ¯Æ°
followline_R(200);
Blackto_White();
followline_L(150);
Blackto_White_R();
followline_R2(150);
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1); //MAILBOX1¤ËSIGNALON1¤òÁ÷¿®
Wait(1000);
arm_up;
turn;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2); //MAILBOX1¤ËSIGNALON2¤òÁ÷¿®
Wait(1000);
followline_R(150);
Blackto_White_L();
followline_L(100);
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(150);
Blackto_White();
turn2;
sakittyo;
arm_down;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1); //MAILBOX1¤ËSIGNALON1¤òÁ÷¿®
Wait(1000);
arm_up;
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2); //MAILBOX1¤ËSIGNALON2¤òÁ÷¿®
Wait(1000);
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
sakittyo;
arm_down;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1); //MAILBOX1¤ËSIGNALON1¤òÁ÷¿®
Wait(1000);
arm_up;
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Blackto_White_R();
followline_R(200);
Blackto_White();
turn2;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2); //MAILBOX1¤ËSIGNALON2¤òÁ÷¿®
Wait(1500);
turn4;
arm_down
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_L(200);
Blackto_White();
followline_R(200);
Blackto_White();
followline_L(200);
Blackto_White();
followline_R(200);
Blackto_White();
followline_L(150);
Blackto_White_R();
followline_R2(125);
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1); //MAILBOX1¤ËSIGNALON1¤òÁ÷¿®
Wait(1000);
arm_up;
turn;
followline_R(100);
Blackto_White_L();
followline_L(100);
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
sakittyo;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2); //MAILBOX1¤ËSIGNALON2¤òÁ÷¿®
Wait(1000);
}
¥´¡¼¥ë¤Î¥È¥ì¡¼¤òGT¡¤¤â¤È¤â¤È¥Ü¡¼¥ë¤òÆþ¤ì¤Æ¤¢¤ë¥È¥ì¡¼¤òST¤È¸Æ¤Ö¤È¡¤ °ì¤ÄÌܤβô¤Ï¡¤M'¤«¤é¥¹~¥¿¡¼¥È¤·L'¤Î¥Ü¡¼¥ë¤òÄϤó¤ÇGT¤ËÆþ¤ì¤ë¤Þ¤Ç¤Î¥×¥í¥°¥é¥à Æó¤ÄÌܤβô¤Ï¡¤L'¤Î¥Ü¡¼¥ë¤òÆþ¤ì¤¿¸å~ST¤Þ¤Ç¹Ô¤¡¤¥Ü¡¼¥ë¤òÄϤà¤Þ¤Ç¤Î¥×¥í¥°¥é¥à »°¤ÄÌܤβô¤Ï¡¤ST¤«¤éGT¤Þ¤Ç¹Ô¤¡¤¥Ü¡¼¥ë¤òÆþ¤ì¤ë~¥×¥í¥°¥é¥à »Í¤ÄÌܤβô¤Ï¡¤¥Ü¡¼¥ë¤òÆþ¤ì¤Æ¤«¤é¤Þ¤¿ST¤Þ¤Ç¹Ô¤¡¤¥Ü¡¼¥ë¤òÄϤà¤Þ¤Ç¤Î¥×¥í¥°¥é¥à ~¸Þ¤ÄÌܤβô¤Ï¡¤¥Ü¡¼¥ë¤òÄϤó¤Ç¤«¤éGT¤Þ¤Ç¹Ô¤¥´¡¼¥ë¤¹¤ë¤Þ¤Ç¤Î¥×¥í¥°¥é¥à Ï»¤ÄÌܤβô¤Ï¡¤ST¤«¤é~L¤Þ¤Ç°Üư¤·¡¤L¤Î¥Ü¡¼¥ë¤òÄϤà¤Þ¤Ç¤Î¥×¥í¥°¥é¥à ¼·¤ÄÌܤβô¤Ï¡¤L¤«¤éGT¤Þ¤Ç°Üư¤·¤Æ¥´¡¼¥ë¤·¡¤~¥È¥ì¡¼¤«¤é¾¯¤·Î¥¤ì¤Þ¤Ç¤Î¥×¥í¥°¥é¥à ¤Ç¤¢¤ë¡¥
*´°À®¤·¤¿¥×¥í¥°¥é¥à [#nd4c0788]
**¥Þ¥¹¥¿¡¼ [#ld48981e]
#define CONN 1
#define SIGNALON1 11
#define SIGNALOFF1 12
#define SIGNALON2 13
#define SIGNALOFF2 14
#define turn_right OnFwd(OUT_C,25);OnRev(OUT_B,23);
#define turn_left OnFwd(OUT_B,28);OnRev(OUT_C,20);
#define rotate_right OnFwd(OUT_C,25);OnRev(OUT_B,22);
#define rotate_left OnFwd(OUT_B,28);OnRev(OUT_C,15);
#define go_straight OnFwd(OUT_B,23);OnFwd(OUT_C,20);
#define go_straight2 OnFwd(OUT_B,20);OnFwd(OUT_C,17);
#define turn OnRev(OUT_C,20);OnFwd(OUT_B,28);Wait(3200);Off(OUT_BC);
#define turn2 OnRev(OUT_B,28);OnFwd(OUT_C,20);Wait(1500);Off(OUT_BC);
#define sakittyo OnFwd(OUT_C,20);OnFwd(OUT_B,23);Wait(1150);Off(OUT_BC);
#define turn3 OnRev(OUT_B,30);Wait(4800);Off(OUT_BC);
#define turn4 OnRev(OUT_B,30);Wait(5200);Off(OUT_BC);
#define back OnRev(OUT_C,20);OnRev(OUT_B,28);Wait(3000);Off(OUT_BC);
#define osidasi OnFwd(OUT_BC,100);Wait(100);Off(OUT_BC);
#define arm_down OnFwd(OUT_A,25);Wait(1500);Off(OUT_A);
#define arm_up OnRev(OUT_A,35);Wait(1500);Off(OUT_A);
#define black 30
#define white 60
#define lightgray 50
#define darkgray 39
#define center 45
sub followline_L(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){
if(SENSOR_1<black){
rotate_left;
}else if(SENSOR_1<darkgray){
turn_left;
}else if(SENSOR_1>lightgray){
turn_right;
t0=CurrentTick();
}else if(SENSOR_1<center){
go_straight;
t0=CurrentTick();
}else{
rotate_right;
t0=CurrentTick();
}
}
Off(OUT_BC);
Wait(1000);
}
sub followline_R(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){
if(SENSOR_1<black){
rotate_right;
}else if(SENSOR_1<darkgray){
turn_right;
}else if(SENSOR_1>lightgray){
turn_left;
t0=CurrentTick();
}else if(SENSOR_1<center){
go_straight;
t0=CurrentTick();
}else{
rotate_left;
t0=CurrentTick();
}
}
Off(OUT_BC);
Wait(1000);
}
sub followline_R2(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){
if(SENSOR_1<black){
rotate_right;
t0=CurrentTick();
}else if(SENSOR_1<darkgray){
turn_right;
t0=CurrentTick();
}else if(SENSOR_1>lightgray){
turn_left;
}else if(SENSOR_1<center){
go_straight2;
t0=CurrentTick();
}else{
rotate_left;
}
}
Off(OUT_BC);
Wait(2000);
}
sub Blackto_White()
{
while(SENSOR_1<lightgray){
OnFwd(OUT_C,25);
OnFwd(OUT_B,25);
}
Off(OUT_BC);
}
sub Whiteto_Black()
{
while(SENSOR_1>darkgray){
OnFwd(OUT_C,25);
OnFwd(OUT_B,25);
}
Off(OUT_BC);
}
sub Blackto_White_R()
{
while(SENSOR_1<darkgray){
OnFwd(OUT_C,25);
OnRev(OUT_B,25);
}
Off(OUT_BC);
}
sub Blackto_White_L()
{
while(SENSOR_1<lightgray){
OnFwd(OUT_B,25);
OnRev(OUT_C,25);
}
Off(OUT_BC);
}
task main()
{
SetSensorLight(S1);
RemoteStartProgram(CONN,"kodomo.nxc");
followline_R(200);
Blackto_White();
followline_L(150);
Blackto_White_R();
followline_R2(150);
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1);
Wait(1000);
arm_up;
turn;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2);
Wait(1000);
followline_R(150);
Blackto_White_L();
followline_L(100);
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(150);
Blackto_White();
turn2;
sakittyo;
arm_down;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1);
Wait(1000);
arm_up;
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2);
Wait(1000);
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
sakittyo;
arm_down;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1);
Wait(1000);
arm_up;
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Blackto_White_R();
followline_R(200);
Blackto_White();
turn2;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2);
Wait(1500);
turn4;
arm_down
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_L(200);
Blackto_White();
followline_R(200);
Blackto_White();
followline_L(200);
Blackto_White();
followline_R(200);
Blackto_White();
followline_L(150);
Blackto_White_R();
followline_R2(125);
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1);
Wait(1000);
arm_up;
turn;
followline_R(100);
Blackto_White_L();
followline_L(100);
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
sakittyo;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2);
Wait(1000);
}
**¥¹¥ì¡¼¥Ö [#yb1b6b06]
#define SIGNALON1 11
#define SIGNALOFF1 12
#define SIGNALON2 13
#define SIGNALOFF2 14
#define CONN 1
task main()
{
int msg;
while(true){
ReceiveRemoteNumber(MAILBOX1,true,msg);
if(msg==SIGNALON1){
OnRev(OUT_A,20);Wait(1000);
}else if(msg==SIGNALOFF1){
Off(OUT_A);
}else if(msg==SIGNALON2){
OnFwd(OUT_A,20);Wait(1000);
}else if(msg==SIGNALOFF2){
Off(OUT_A);
}
}
}
*¤Þ¤È¤á [#b5c75a06]
º£²ó¤Î²ÝÂê¤Ç¤Ï¥×¥í¥°¥é¥ß¥ó¥°¤â¥í¥Ü¥Ã¥È¤ÎºîÀ®¤â¿¤¯¤Î»þ´Ö¤òÈñ¤ä¤·¤¿¡£~
¥í¥Ü¥Ã¥È¤ÎºîÀ®¤Ç¤Ï¡¢¥í¥Ü¥Ã¥È¤Î·Á¡¢¥Ü¡¼¥ë¤ò±¿¤ÖÊýË¡¤Ê¤ÉÍÍ¡¹¤Ê»ö¤ò¹Í¤¨~
ºîÀ®¤·¤¿¡£¥×¥í¥°¥é¥à¤Ç¤Ï¥é¥¤¥ó¥È¥ì¡¼¥¹¤Ï²ÝÂꣲ¤Ç»ÈÍѤ·¤¿¥â¥Î¤ò¤Þ¤ó¤Þ~
»È¤Ã¤Æ¡¢ÏÀÍý¾å¤Ç¤Ï¤¤Á¤ó¤È¥³¡¼¥¹¾å¤ò´°àú¤Ëư¤¯¤â¤Î¤¬ºî¤ì¤¿¤¬¡¢¸½¼ÂÌäÂê~
¤È¤·¤Æ¡¢ÅÅÃÓ¤¬Àڤ줿¤Î¤¬¸¶°ø¤À¤È»×¤¦¤¬¡¢½ÐÎϤ¬¤¹¤°¤Ë¼å¤¯¤Ê¤Ã¤¿¤ê¡¢~
ÊÒÊý¤Î¥â¡¼¥¿¡¼¤¬ÉÔÄ´¤ÇƱ¤¸½ÐÎϤÇľ¿Ê¤µ¤»¤Æ¤â¶Ê¤¬¤Ã¤Æ¤·¤Þ¤¦¤È¤¤¤¦~
¤è¤¦¤Ê¤³¤È¤¬¤¢¤ê¡¢½ÐÎϤäÉÿô¤òËè²óËè²óÄ´À°¤·¤¿¤ê¤¹¤ë¤Î¤Ë¤«¤Ê¤ê~
»þ´Ö¤¬¤«¤«¤Ã¤¿¡£¤À¤¬¡¢ºÇ½ªÅª¤Ë¥í¥Ü¥³¥ó¤Ç¥Ü¡¼¥ë¤ò°ì¤Ä¤·¤«¥È¥ì¡¼¤Ë~
Æþ¤ì¤é¤ì¤Ê¤«¤Ã¤¿¤¬Æó°Ì¤È¤¤¤¦·ë²Ì¤À¤Ã¤¿¤Î¤Ç¡¢¼«Ê¬¤È¤·¤Æ¤Ï°¤¯¤Ï¤Ê¤¤·ë²Ì~
½Ð²ñ¤Ã¤¿¤È»×¤¦¡£
½ªÎ»¹Ô:
Ìܼ¡
#contents
*²ÝÂê¤Ë¤Ä¤¤¤Æ [#z31d1a0c]
**²ÝÂê¤Î¾ÜºÙ [#j3756556]
¥Ü¡¼¥ë¤ò±¿¤Ö¤¿¤á¤Î¥í¥Ü¥Ã¥È¤òºîÀ®¤·¡¢¥Ü¡¼¥ë¤ò±¿È¤·¤Æ½êÄê¤ÎÍÆ´ï¤ÎÃæ¤ËÆþ¤ì¤ë¡£
#ref(2019a/Member/Gouki/Mission3/map3.png,100%);
**¥Õ¥£¡¼¥ë¥É¤ÎÀâÌÀ [#x07bc6d6]
-¥Õ¥£¡¼¥ë¥É¤Ï²ÝÂê2¤Ç»ÈÍѤ·¤¿»æ¤ò»ÈÍѤ¹¤ë¡£
-À¸¶¨¤Î¤ªÊÛÅö¤Î»Í³Ñ¤¤¥×¥éÍÆ´ï2¤Ä¤ò¤½¤ì¤¾¤ì±ßÆâ¤ËÃÖ¤¡¢ÊÒÊý¤Ë¶Ì¤ò2¸ÄÆþ¤ì¤ë¡£
-»Ä¤ê¤Î2¸Ä¤Î¶Ì¤Ï²ÝÂê2¤ÈƱ¤¸°ÌÃÖ¤ËÃÖ¤¯¡£¤½¤ÎºÝ¡¢¥´¥à¥¿¥¤¥ä¤ä¥×¥ì¡¼¥È¤Î¾å¤ËÃÖ¤¤¤Æ¤â¤è¤¤¡£
-¥×¥éÍÆ´ï¤Ë¤Ï¿§¤ò¤Ä¤±¤¿¤êʸ»ú¤äµ¹æ¤ò½ñ¤¤¤Æ¤â¤è¤¤¡£
-¥×¥éÍÆ´ï¤ÏξÌ̥ơ¼¥×Åù¤Ç¥Õ¥£¡¼¥ë¥É¤Ë¸ÇÄꤷ¤Æ¤â¤è¤¤¡£
-2Ëç¤Î»æ¤Î¶³¦¤Ë¤Ï¤½¤ì¤¾¤ìÉý1cm¡¢¹ç·×2cm¤Î¹õÀþ¤òÉÁ¤¤¤Æ¤â¤è¤¤¡£
**´ðËܥ롼¥ë [#w587e337]
-¶¥µ»»þ´Ö¤Ï¿³È½¤¬Â³¹ÔÉÔǽ¤ÈȽÃǤ¹¤ë¤Þ¤Ç¡¢¤¢¤ë¤¤¤Ï¥ê¥¿¥¤¥¢¤¹¤ë¤Þ¤Ç¡£
-¿Þ¤ÎAÃÏÅÀ¤Þ¤¿¤Ï¡Ê¤ª¤è¤Ó¡ËA'ÃÏÅÀ¤«¤é¥¹¥¿¡¼¥È¤¹¤ë¡£¤¿¤À¤·ÀÜÃϤ·¤Æ¤¤¤ëÉôʬ¤Ï¤½¤ì¤¾¤ì¤ÎÎΰè-Æâ¤Ë¼ý¤Þ¤ë¤â¤Î¤È¤¹¤ë¡ÊÀþ¾å¤ÏOK¡Ë¡£¾å¶õÉôʬ¤ÏÎΰ褫¤é¤Ï¤ß½Ð¤·¤Æ¤¤¤Æ¤â¤è¤¤¡£
-³«»Ï¤Î¹ç¿Þ¤«¤é£µÉÃ°ÊÆâ¤Ë¥¹¥¿¡¼¥È¥Ü¥¿¥ó¤ò²¡¤¹ºî¶È¤ò´°Î»¤¹¤ë¤³¤È¡£
-¶¥µ»¤¬½ªÎ»¤¹¤ë¤Þ¤Ç¡¢¥í¥Ü¥Ã¥È¤Ë¿¨¤Ã¤¿¤ê¿Í´Ö¤¬±ó³Ö¤ÇÁàºî¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
-ÅÓÃæ¤Ç¤¦¤Þ¤¯Æ°¤«¤Ê¤¯¤Ê¤Ã¤¿¾ì¹ç¡¢£±²ó¸Â¤êºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡ÊºÆ¥¹¥¿¡¼¥È¤ÎºÝ¤ËÊÌ¥×¥í¥°¥é¥à¤Çµ¯Æ°¤·¤Æ¤è¤¤¡Ë¡£
-¶¥µ»½ªÎ»¸å¡¢¥í¥Ü¥Ã¥È¤¬¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤Ë¿¨¤ì¤Æ¤¤¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
-¶¥µ»½ªÎ»¸å¡¢¤â¤È¤â¤È¶Ì¤¬Æþ¤Ã¤Æ¤¤¤¿¥×¥éÍÆ´ï¤¬¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤Ë¿¨¤ì¤Æ¤¤¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
**´ðËÜÆÃŵ¤Î·×»»ÊýË¡ [#v3e9c93a]
-¥×¥éÍÆ´ïÆâ¤Î¶Ì¤ò1¸Ä±¿¤Ù¤Ð8ÅÀ¡£Æó¤Ä¤È¤â±¿¤Ù¤Ð20ÅÀ¡£
-LÃÏÅÀ¤ÈL'ÃÏÅÀ¤Î¶Ì¤ò¤É¤Á¤é¤«1¸Ä±¿¤Ù¤Ð4ÅÀ¡¢2¸Ä¤È¤â±¿¤Ù¤Ð12ÅÀ¡£
-¶¥µ»½ªÎ»¸å¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤¬´°Á´¤Ë±ß¤«¤é½Ð¤·¤Þ¤Ã¤¿¾ì¹ç¡¢¤â¤È¤Î´ðËÜÅÀ¤Î1/4¤ò¸ºÅÀ¡£
-¶¥µ»½ªÎ»¸å¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤ÎȾʬ°Ê¾å¤¬±ß¤«¤é½Ð¤Æ¤¤¤ì¤Ð¡¢¤â¤È¤Î´ðËÜÅÀ¤Î3/4¤ò¸ºÅÀ¡£
-¶¥µ»½ªÎ»¸å¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤Ë¤â¤È¤Î¥×¥éÍÆ´ï¤¬¿¨¤ì¤Æ¤¤¤ì¤Ð¡¢¤â¤È¤Î´ðËÜÅÀ¤Î1/2¤ò¸ºÅÀ¡£
-¶¥µ»½ªÎ»¸å¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤Ë¤â¤È¤Î¥×¥éÍÆ´ï¤¬¿¨¤ì¤Æ¤¤¤ì¤Ð¡¢¤â¤È¤Î´ðËÜÅÀ¤Î1/2¤ò¸ºÅÀ¡£
-¶¥µ»½ªÎ»¸å¡¢¥´¡¼¥ë¤Î¥×¥éÍÆ´ï¤Ë¥í¥Ü¥Ã¥È¤¬¿¨¤ì¤Æ¤¤¤ì¤Ð¡¢¤â¤È¤Î´ðËÜÅÀ¤Î1/4¤ò¸ºÅÀ¡£
**µ»½ÑŸ¤Î·×»»ÊýË¡ [#t74989b1]
°Ê²¼¤Îưºî¤ÎÀºÅÙ¡¦¥¹¥Ô¡¼¥É¡¦³Î¼ÂÀ¤Ê¤É¤ò´Þ¤á¤¿µ»½ÑŪ¤Ê¹©Éפä·Ý½ÑÀ¤Ë¤Ä¤¤¤ÆÂ¾¤ÎÁ´¤Æ¤Î¥Á¡¼¥à(5¥Á¡¼¥à)¤¬20ÅÀËþÅÀ¤ÇºÎÅÀ¤·¡¢¤½¤ÎÊ¿¶ÑÅÀ¤òµá¤á¤ë¡£ ÆÀÅÀ¤ÎÌܰ¡§
-¶Ì¤òõ¤·¼è¤ê¤Ë¤¤¤¯¤Þ¤Ç¤Îưºî (3ÅÀ)
-¶Ì¤òÄÏ¤àÆ°ºî (3ÅÀ)
-¶Ì¤ò¤ò±¿¤Öưºî (2ÅÀ)
-¶Ì¤òÍÆ´ï¤ÎÃæ¤ËÆþ¤ì¤ëưºî (2ÅÀ)
-2Âæ¤ÎRIS¡¢NXT¡¢EV3¤ÎÏ¢·È¤ÎÎɤµ(2ÅÀ)
-¼«Î©·¿¤Î¥í¥Ü¥Ã¥È¤È¤·¤Æ¤Î·Á¤äưºî¤ÎÈþ¤·¤µ¡¢»Â¿·¤µ(2ÅÀ)
-¤½¤Î¾ (3ÅÀ)
*¥í¥Ü¥Ã¥È¤Ë¤Ä¤¤¤Æ [#dc407bb5]
»ä¤¿¤Á¤Î¥í¥Ü¥Ã¥È¤Ï¥Ü¡¼¥ë¤ò°ì¤Ä¤º¤Ä±¿È½ÐÍè¤ë¤è¤¦¤Ê¥í¥Ü¥Ã¥È¤òºîÀ®¤·¤Þ¤·¤¿¡£~
¤½¤Î¤¿¤á¤¤Á¤ó¤È¾®²ó¤ê¤¬¤¤¯¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ë¡¢¥³¥ó¥Ñ¥¯¥È¤Ê·Á¤Ë»Å¾å¤²¤·¤Þ¤·¤¿¡£
#ref(2019a/Member/Gouki/Mission3/¤ß¤Ã¤·¤è¤ó3_190814_0005.jpg,15%);
#ref(2019a/Member/Gouki/Mission3/¤ß¤Ã¤·¤è¤ó3_190814_0004.jpg,15%);
#ref(2019a/Member/Gouki/Mission3/¤ß¤Ã¤·¤è¤ó3_190814_0003.jpg,15%);
**ËÜÂÎÉôʬ [#rfb9cbf5]
¤Ê¤ë¤Ù¤¯¾®¤µ¤¯¥³¥ó¥Ñ¥¯¥È¤Ëºî¤Ã¤¿¡£ËÜÂΤòÇØÌ̤¢¤ï¤»¤Ë¤·¡¢ÌµÂ̤ʶõ´Ö¤ò̵¤¯¤·¤¿¡£~
¥»¥ó¥µ¡¼¤Ï¼ÖÎØ¤Ë¶á¤Å¤±¡¢¤¤Á¤ó¤È¾®²ó¤ê¤¬²Äǽ¤Ê¥»¥ó¥µ¡¼¸¡ÃΤò½ÐÍè¤ë¤è¤¦¤Ë¤·¤¿¡£
#ref(2019a/Member/Gouki/Mission3/asimawari.jpg,30%);
**¥¢¡¼¥àÉôʬ [#n6f8d1c4]
¥¢¡¼¥à¤ÎÉôʬ¤âËÜÂÎÆ±ÍÍ¥·¥ó¥×¥ë¤Ë¤·¡¢¥â¡¼¥¿¡¼¤ËľÀÜÉôÉʤò¤Ä¤±¡¢²óž¤µ¤»¥¢¡¼¥à¤òư¤«¤·¡¢~
¥Ü¡¼¥ë¤ò¤Ä¤«¤ó¤À¤êÎ¥¤·¤¿¤ê½ÐÍè¤ë¤è¤¦¤Ê¥¯¥ì¡¼¥ó·¿¤Î¥¢¡¼¥à¤ËÍî¤ÁÃ夤¤¿¡£
#ref(2019a/Member/Gouki/Mission3/Inked¤ß¤Ã¤·¤è¤ó3_190814_0002_LI.jpg,15%);
#ref(2019a/Member/Gouki/Mission3/Inked¤ß¤Ã¤·¤è¤ó3_190814_0001_LI.jpg,15%);
#ref(2019a/Member/Gouki/Mission3/Inked¤ß¤Ã¤·¤è¤ó3_190814_00021_LI.jpg,15%);
¥¢¡¼¥à¤ò°ìÈÖ¾å¤Þ¤Ç¾å¤²¤ë¤¿¤á¤Ë¡¢Êä½õ¤È¤·¤ÆÎØ¥´¥à¤ò»È¤Ã¤¿¡£
#ref(2019a/Member/Gouki/Mission3/Inked¤ß¤Ã¤·¤è¤ó3_190814_0005_LI.jpg,15%);
*ºîÀï [#z667c8b6]
**¥ë¡¼¥È¤Ë¤Ä¤¤¤Æ [#i3296f07]
»ä¤¿¤Á¤Ï¥Ü¡¼¥ë¤ò°ì¤Ä¤º¤Ä±¿È¤¹¤ë¥í¥Ü¥Ã¥È¤òºî¤Ã¤¿¤¿¤á¡¢¥Ü¡¼¥ë¤ò¤Ä¤«¤ß~
¥È¥ì¡¼¤Ë»ý¤Ã¤Æ¤¤¤¡¢¥Ü¡¼¥ë¤òÎ¥¤¹¤È¤¤¤¦¹Ôư¤ò¹ç·×£´²ó¹Ô¤¦É¬Íפ¬¤¢¤ë¡£
¤½¤Î¤¿¤á¼¡¤Î¤è¤¦¤Ê¥ë¡¼¥È¤Ç¥í¥Ü¥Ã¥È¤òư¤«¤¹¤³¤È¤Ë¤·¤¿¡£
#ref(2019a/Member/Gouki/Mission3/¤ß¤Ã¤·¤è¤ó3_190814_0007.jpg,50%);
¡A'¤ò½Ðȯ¤·L'¤Î¥Ü¡¼¥ë¤òÄϤߡ¤Àû²ó¤·¤ÆÍÆ´ï¤ËÆþ¤ì¤ë¡¥
#ref(2019a/Member/Gouki/Mission3/route1.png,50%);
¢¼¡¤Ë¡¤¤½¤³¤«¤éľÀþ¤òÆÍ¤ÃÀڤäÆÍÆ´ï¤ÎÃæ¤Î¥Ô¥ó¥Ý¥ó¶Ì¤òÄϤߥ´¡¼¥ë¤Ë¤¢¤ëÍÆ´ï¤ËÆþ¤ìÂØ¤¨¤ë¡¥
#ref(2019a/Member/Gouki/Mission3/route2.png,50%);
£Æ±¤¸¤¯ÍÆ´ï¤ÎÃæ¤Î¥Ü¡¼¥ë¤ò¥´¡¼¥ë¤ÎÍÆ´ï¤Ë»ý¤Ã¤Æ¤¤¤Æþ¤ì¤ë¡¥
#ref(2019a/Member/Gouki/Mission3/route3.png,50%);
¤ºÇ¸å¤Ë¡¤L¤Ë¤¢¤ë¥Ü¡¼¥ë¤òÄϤߥ´¡¼¥ë¤ÎÍÆ´ï¤ËÆþ¤ì¤ë
#ref(2019a/Member/Gouki/Mission3/route4.png,50%);
*¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ [#h6c4ad2e]
º£²ó¤ÏËÜÂΤò£²µ¡»È¤¤¡¢
-¥Þ¥¹¥¿¡¼¡§Î¾¼ÖÎØ¡¢¥¢¡¼¥à¤Î¾å¤²²¼¤²
-¥¹¥ì¡¼¥Ö¡§¥Ü¡¼¥ë¤ò¤Ä¤«¤àưºî
¤È¤¤¤¦¤è¤¦¤Ëưºî¤òʬ¤±¤Æ¡¢¥×¥í¥°¥é¥ß¥ó¥°¤òºî¤Ã¤¿¡£
**¶¦ÄÌ¤Î¥×¥í¥°¥é¥à [#n4cc6b0d]
2µ¡´Ö¤ÇÄÌ¿®¤¹¤ë¤¿¤á¤Ë°Ê²¼¤Î¥Þ¥¯¥í¤òÄêµÁ¤·¤¿¡£
#define SIGNALON1 11
#define SIGNALOFF1 12
#define SIGNALON2 13
#define SIGNALOFF2 14
**¥¢¡¼¥à¤Î¥×¥í¥°¥é¥à(¥¹¥ì¡¼¥Ö¦¤Î¥×¥í¥°¥é¥à) [#ife08613]
***¥¢¡¼¥à¤Î¾å¤²²¼¤²¤Î¥Þ¥¯¥í [#yfbde368]
#define arm_down OnFwd(OUT_A,25);Wait(1500);Off(OUT_A); //¥¢¡¼¥à¤ò²¼¤²¤ë
#define arm_up OnRev(OUT_A,35);Wait(1500);Off(OUT_A); //¥¢¡¼¥à¤ò¾å¤²¤ë
***¥¹¥ì¡¼¥Ö¤Î¥×¥í¥°¥é¥à [#x33fd690]
#define SIGNALON1 11
#define SIGNALOFF1 12
#define SIGNALON2 13
#define SIGNALOFF2 14
#define CONN 1 //¥Þ¥¹¥¿¡¼¤ÎÀܳÈÖ¹æ
task main()
{
int msg; //¼õ¤±¼è¤Ã¤¿Ãͤò³ÊǼ¤¹¤ëÊÑ¿ô
while(true){
ReceiveRemoteNumber(MAILBOX1,true,msg); //MAILBOX1¤ÎÃͤò¼õ¤±¼è¤êmsg¤Ë³ÊǼ
if(msg==SIGNALON1){¡¡¡¡¡¡¡¡¡¡¡¡¡¡//SIGNALON1¤ò¼õ¿®¤·¤¿¤È¤
OnRev(OUT_A,20);Wait(1000);¡¡//¥Ü¡¼¥ë¤òÄϤà
}else if(msg==SIGNALOFF1){¡¡¡¡¡¡ //SIGNALOFF1¤ò¼õ¿®¤·¤¿¤È¤
Off(OUT_A);¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¥â¡¼¥¿A¤ò»ß¤á¤ë
}else if(msg==SIGNALON2){¡¡¡¡¡¡¡¡//SIGNALON2¤ò¼õ¿®¤·¤¿¤È¤
OnFwd(OUT_A,20);Wait(1000);¡¡//¥Ü¡¼¥ë¤òÊü¤¹
}else if(msg==SIGNALOFF2){¡¡¡¡¡¡ //SIGNALOFF2¤ò¼õ¿®¤·¤¿¤È¤
Off(OUT_A);¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//¥â¡¼¥¿A¤ò»ß¤á¤ë
}
}
}
**¥é¥¤¥ó¥È¥ì¡¼¥¹ [#zd28da58]
***¥Þ¥¯¥í [#h278ba8e]
»ä¤¿¤Á¤Ï¡Ö´°Á´¤Ë¿¿¤ÃÇò¡×¡¢¡ÖÇò¤È¶Ìܤδ֡ס¢¡Ö¶Ìܡס¢¡Ö¹õ¤È¶Ìܤδ֡ס¢~
¡Ö´°Á´¤Ë¹õ¡×¤Î£µ¤Ä¤ÎÉôʬ¤Ë¿§¤òʬ¤±¤ÆÂ¬¤Ã¤¿¡£~
¸÷¥»¥ó¥µ¡¼¤Ç¸¡ÃΤ¹¤ë¿ôÃͤò°Ê²¼¤Î¥Þ¥¯¥í¤ÇÄêµÁ¤·¤¿¡£
#define black 30
#define white 60
#define lightgray 50
#define darkgray 39
#define center 45
#ref(2019a/Member/Gouki/Mission3/light_sennser.png,15%);
¤½¤Î¾ÍÍ¡¹¤Êưºî¤ò°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤·¤¿¡£
#define turn_right OnFwd(OUT_C,25);OnRev(OUT_B,23); //±¦ÀÞ
#define turn_left OnFwd(OUT_B,28);OnRev(OUT_C,20); //º¸ÀÞ
#define rotate_right OnFwd(OUT_C,25);OnRev(OUT_B,22); //±¦Àû²ó
#define rotate_left OnFwd(OUT_B,28);OnRev(OUT_C,15); //º¸Àû²ó
#define go_straight OnFwd(OUT_B,23);OnFwd(OUT_C,20); //ľ¿Ê
#define go_straight2 OnFwd(OUT_B,20);OnFwd(OUT_C,17); //K'¤«¤éL'¤Ç¤Î½ÐÎϼå¤á¤Îľ¿Ê
#define turn OnRev(OUT_C,20);OnFwd(OUT_B,28);Wait(3200);Off(OUT_BC); //L'¤Î¥Ü¡¼¥ëÄϤó¤Ç ¤«¤éÆþ¤ì¤ë¤Þ¤Ç¤ÎÀû²ó
#define turn2 OnRev(OUT_B,28);OnFwd(OUT_C,20);Wait(1500);Off(OUT_BC); //¥Ü¡¼¥ë¤ÎÆþ¤Ã¤Æ¤ë¥È¥ì¡¼¤Ø¤Î¤ï¤º¤«¤ÊÄ´À°
#define sakittyo OnFwd(OUT_C,20);OnFwd(OUT_B,23);Wait(1150);Off(OUT_BC); //¥Ü¡¼¥ë¤¬Æþ¤Ã¤Æ¤ë¥È¥ì¡¼Á°¤Ç¤Î¤ï¤º¤«¤ÊÁ°¿Ê
#define turn3 OnRev(OUT_B,30);Wait(4800);Off(OUT_BC); //¥È¥ì¡¼¤Î¥Ü¡¼¥ë¤òÄϤó¤À¸å¤ÎÊý¸þž´¹
#define turn4 OnRev(OUT_B,30);Wait(5200);Off(OUT_BC); //
#define back OnRev(OUT_C,20);OnRev(OUT_B,28);Wait(3000);Off(OUT_BC); //ºÇ¸å¥È¥ì¡¼¤Ë¿¨¤ì¤Ê¤¤¤è¤¦¤Ë¾¯¤·Î¥¤ì¤ë
***º¸Â¦¤Î¥é¥¤¥ó¥È¥ì¡¼¥¹ [#a05ab4c7]
sub followline_L(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){ //¸½ºß¤Î»þ¹ï¤¬°ìÄê¤ÎÃͤòͤ¨¤ë¤Þ¤Ç
if(SENSOR_1<black){ //¥»¥ó¥µ¡¼¤¬¹õ¤Î»þ
rotate_left; //º¸Àû²ó
}else if(SENSOR_1<darkgray){ //¥»¥ó¥µ¡¼¤¬¹õ³¥¤Ê¤é
turn_left; //º¸ÀÞ
}else if(SENSOR_1>lightgray){ //¥»¥ó¥µ¡¼¤¬Çò³¥¤Ê¤é
turn_right; //±¦ÀÞ
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else if(SENSOR_1<center){ //ÌÀ¤ë¤µ45°Ê²¼¤Ç
go_straight; //ľ¿Ê
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else{ //¤½¤ì°Ê³°¤Ï
rotate_right; //±¦Àû²ó
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}
}
Off(OUT_BC); //»þ¹ï¤¬°ìÄê¤ÎÃͤòͤ¨¤ë¤ÈÄä»ß
Wait(1000); //1ÉôÖÄä»ß
}
***±¦Â¦¤Î¥é¥¤¥ó¥È¥ì¡¼¥¹ [#qa9b1ed2]
sub followline_R(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){ //¸½ºß¤Î»þ¹ï¤¬°ìÄê¤ÎÃͤòͤ¨¤ë¤Þ¤Ç
if(SENSOR_1<black){ //¥»¥ó¥µ¡¼¤¬¹õ¤Î»þ
rotate_right; //±¦Àû²ó
}else if(SENSOR_1<darkgray){ //¥»¥ó¥µ¡¼¤¬¹õ³¥¤Ê¤é
turn_right; //±¦ÀÞ
}else if(SENSOR_1>lightgray){ //¥»¥ó¥µ¡¼¤¬Çò³¥¤Ê¤é
turn_left; //º¸ÀÞ
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else if(SENSOR_1<center){ //¥»¥ó¥µ¡¼¤¬45°Ê²¼¤Ê¤é
go_straight; //ľ¿Ê
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else{ //¤½¤ì°Ê³°¤Ï
rotate_left; //º¸Àû²ó
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}
}
Off(OUT_BC); //°ìÄê¤Î»þ´Ö¤òͤ¨¤ë¤ÈÄä»ß
Wait(1000); //°ìÉôÖÄä»ß
}
Ëô¡¢K,L´Ö¡¢K`,L`´Ö¤Ç¤Ï¤½¤Î¤Þ¤Þ¤Î½ÐÎϤÇľ¿Ê¤·¤Æ¤·¤Þ¤¦¤È¥Ü¡¼¥ë¤Ë¿¨¤ì¤¿ºÝ¤Ë~
¥Ü¡¼¥ë¤òÈô¤Ð¤·¤Æ¤·¤Þ¤¦²ÄǽÀ¤¬¤¢¤ë¤¿¤á¡¢¤³¤ÎÉôʬ¤À¤±Ä¾¿Ê¤Î½ÐÎϤ¬¼å¤¯¤Ê¤ë¤è¤¦¤Ê~
±¦Â¦¥é¥¤¥ó¥È¥ì¡¼¥¹¤Ë¤·¤¿¡£¤½¤ì¤¬²¼µ¤Î¥×¥í¥°¥é¥à¤Ç¤¢¤ë¡£
sub followline_R2(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){ //»þ¹ï¤¬¤¢¤ë°ìÄê¤ÎÃͤè¤ê¾®¤µ¤¤¤È¤
if(SENSOR_1<black){ //¹õ¤Ê¤é
rotate_right; //±¦Àû²ó
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else if(SENSOR_1<darkgray){ //³¥¹õ¿§¤Ê¤é
turn_right; //±¦ÀÞ
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else if(SENSOR_1>lightgray){ //³¥Çò¿§¤Ê¤é
turn_left; //º¸ÀÞ
}else if(SENSOR_1<center){ //ÌÀ¤ë¤µ45°Ê²¼¤Ç
go_straight2; //¤æ¤Ã¤¯¤êľ¿Ê
t0=CurrentTick(); //»þ´Ö¤ò¥ê¥»¥Ã¥È
}else{ //¤½¤ì°Ê³°¤Ê¤é
rotate_left; //º¸Àû²ó
}
}
Off(OUT_BC); //Ää»ß
Wait(2000); //2ÉôÖÄä»ß
}
***²£ÃÇ [#d41cbe46]
Æó¤Ä¤Î¥Þ¥Ã¥×¤ò²£ÃǤ¹¤ëºÝ¡¢¹õ¤ò¸«¤Ä¤±¤ë¤Þ¤Çľ¿Ê¤¹¤ë¥×¥í¥°¥é¥à¤ÈÇò¤ò¸«¤Ä¤±¤ë¤Þ¤Çľ¿Ê¤¹¤ë~
¥×¥í¥°¥é¥à¤ò¸ò¸ß¤ËÁȤ߹ç¤ï¤»¤Æ²£ÃǤ¹¤ë
-¹õ¤ò¸«¤Ä¤±¤ë¤Þ¤Çľ¿Ê
sub Blackto_White()
{
while(SENSOR_1<lightgray){¡¡//¸÷¥»¥ó¥µ¡¼¤ÎÃͤ¬Çò³¥¤è¤ê¾®¤µ¤¤¤È¤
OnFwd(OUT_C,25);¡¡¡¡¡¡¡¡¡¡¡¡
OnFwd(OUT_B,25);¡¡¡¡¡¡¡¡¡¡¡¡//ľ¿Ê
}
Off(OUT_BC);¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡//Çò³¥¤è¤êÂ礤¯¤Ê¤ë¤È»ß¤Þ¤ë
}
-Çò¤ò¸«¤Ä¤±¤ë¤Þ¤Çľ¿Ê
sub Whiteto_Black()
{
while(SENSOR_1>darkgray){¡¡//¸÷¥»¥ó¥µ¡¼¤ÎÃͤ¬¹õ³¥¤è¤ê¤âÂ礤¤¤È¤
OnFwd(OUT_C,25);¡¡¡¡¡¡¡¡¡¡
OnFwd(OUT_B,25); //ľ¿Ê
}
Off(OUT_BC); //¹õ³¥¤è¤ê¤âÂ礤¯¤Ê¤ë¤È»ß¤Þ¤ë
}
Ëô¡¢¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î±¦Â¦¤Èº¸Â¦¤òÆþ¤ìÂØ¤¨¤ë»þ¤Ë»È¤¦²£ÃÇ¤Î¥×¥í¥°¥é¥à¤¬¤¢¤ë¡£
-¹õ¤ò¸«¤Ä¤±¤ë¤Þ¤Ç±¦Àû²ó
sub Whiteto_Black_R()
{
while(SENSOR_1>darkgray){¡¡//¸÷¥»¥ó¥µ¡¼¤ÎÃͤ¬¹õ³¥¤è¤ê¤âÂ礤¤¤È¤
OnFwd(OUT_C,25);¡¡¡¡¡¡¡¡¡¡
OnRev(OUT_B,25); //±¦Àû²ó
}
Off(OUT_BC); //¹õ³¥¤è¤ê¤â¾®¤µ¤¯¤Ê¤ë¤È»ß¤Þ¤ë
}
-¹õ¤ò¸«¤Ä¤±¤ë¤Þ¤Çº¸Àû²ó
sub Whiteto_Black_L()
{
while(SENSOR_1>black){¡¡//¸÷¥»¥ó¥µ¡¼¤ÎÃͤ¬¹õ¤è¤êÂ礤¤¤È¤
OnFwd(OUT_B,25);
OnRev(OUT_C,25); //º¸Àû²ó
}
Off(OUT_BC); //¹õ¤è¤ê¾®¤µ¤¤¤È¤
}
**¥Þ¥¹¥¿¡¼¤Î¥×¥í¥°¥é¥à [#g32bc84d]
task main()
{
SetSensorLight(S1); //ü»Ò£±¤Ë¸÷¥»¥ó¥µ¡¼
RemoteStartProgram(CONN,"kodomo.nxc");¡¡¡¡//¥¹¥ì¡¼¥Ö¤Î¥×¥í¥°¥é¥à¤òµ¯Æ°
followline_R(200);
Blackto_White();
followline_L(150);
Blackto_White_R();
followline_R2(150);
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1); //MAILBOX1¤ËSIGNALON1¤òÁ÷¿®
Wait(1000);
arm_up;
turn;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2); //MAILBOX1¤ËSIGNALON2¤òÁ÷¿®
Wait(1000);
followline_R(150);
Blackto_White_L();
followline_L(100);
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(150);
Blackto_White();
turn2;
sakittyo;
arm_down;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1); //MAILBOX1¤ËSIGNALON1¤òÁ÷¿®
Wait(1000);
arm_up;
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2); //MAILBOX1¤ËSIGNALON2¤òÁ÷¿®
Wait(1000);
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
sakittyo;
arm_down;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1); //MAILBOX1¤ËSIGNALON1¤òÁ÷¿®
Wait(1000);
arm_up;
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Blackto_White_R();
followline_R(200);
Blackto_White();
turn2;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2); //MAILBOX1¤ËSIGNALON2¤òÁ÷¿®
Wait(1500);
turn4;
arm_down
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_L(200);
Blackto_White();
followline_R(200);
Blackto_White();
followline_L(200);
Blackto_White();
followline_R(200);
Blackto_White();
followline_L(150);
Blackto_White_R();
followline_R2(125);
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1); //MAILBOX1¤ËSIGNALON1¤òÁ÷¿®
Wait(1000);
arm_up;
turn;
followline_R(100);
Blackto_White_L();
followline_L(100);
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
sakittyo;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2); //MAILBOX1¤ËSIGNALON2¤òÁ÷¿®
Wait(1000);
}
¥´¡¼¥ë¤Î¥È¥ì¡¼¤òGT¡¤¤â¤È¤â¤È¥Ü¡¼¥ë¤òÆþ¤ì¤Æ¤¢¤ë¥È¥ì¡¼¤òST¤È¸Æ¤Ö¤È¡¤ °ì¤ÄÌܤβô¤Ï¡¤M'¤«¤é¥¹~¥¿¡¼¥È¤·L'¤Î¥Ü¡¼¥ë¤òÄϤó¤ÇGT¤ËÆþ¤ì¤ë¤Þ¤Ç¤Î¥×¥í¥°¥é¥à Æó¤ÄÌܤβô¤Ï¡¤L'¤Î¥Ü¡¼¥ë¤òÆþ¤ì¤¿¸å~ST¤Þ¤Ç¹Ô¤¡¤¥Ü¡¼¥ë¤òÄϤà¤Þ¤Ç¤Î¥×¥í¥°¥é¥à »°¤ÄÌܤβô¤Ï¡¤ST¤«¤éGT¤Þ¤Ç¹Ô¤¡¤¥Ü¡¼¥ë¤òÆþ¤ì¤ë~¥×¥í¥°¥é¥à »Í¤ÄÌܤβô¤Ï¡¤¥Ü¡¼¥ë¤òÆþ¤ì¤Æ¤«¤é¤Þ¤¿ST¤Þ¤Ç¹Ô¤¡¤¥Ü¡¼¥ë¤òÄϤà¤Þ¤Ç¤Î¥×¥í¥°¥é¥à ~¸Þ¤ÄÌܤβô¤Ï¡¤¥Ü¡¼¥ë¤òÄϤó¤Ç¤«¤éGT¤Þ¤Ç¹Ô¤¥´¡¼¥ë¤¹¤ë¤Þ¤Ç¤Î¥×¥í¥°¥é¥à Ï»¤ÄÌܤβô¤Ï¡¤ST¤«¤é~L¤Þ¤Ç°Üư¤·¡¤L¤Î¥Ü¡¼¥ë¤òÄϤà¤Þ¤Ç¤Î¥×¥í¥°¥é¥à ¼·¤ÄÌܤβô¤Ï¡¤L¤«¤éGT¤Þ¤Ç°Üư¤·¤Æ¥´¡¼¥ë¤·¡¤~¥È¥ì¡¼¤«¤é¾¯¤·Î¥¤ì¤Þ¤Ç¤Î¥×¥í¥°¥é¥à ¤Ç¤¢¤ë¡¥
*´°À®¤·¤¿¥×¥í¥°¥é¥à [#nd4c0788]
**¥Þ¥¹¥¿¡¼ [#ld48981e]
#define CONN 1
#define SIGNALON1 11
#define SIGNALOFF1 12
#define SIGNALON2 13
#define SIGNALOFF2 14
#define turn_right OnFwd(OUT_C,25);OnRev(OUT_B,23);
#define turn_left OnFwd(OUT_B,28);OnRev(OUT_C,20);
#define rotate_right OnFwd(OUT_C,25);OnRev(OUT_B,22);
#define rotate_left OnFwd(OUT_B,28);OnRev(OUT_C,15);
#define go_straight OnFwd(OUT_B,23);OnFwd(OUT_C,20);
#define go_straight2 OnFwd(OUT_B,20);OnFwd(OUT_C,17);
#define turn OnRev(OUT_C,20);OnFwd(OUT_B,28);Wait(3200);Off(OUT_BC);
#define turn2 OnRev(OUT_B,28);OnFwd(OUT_C,20);Wait(1500);Off(OUT_BC);
#define sakittyo OnFwd(OUT_C,20);OnFwd(OUT_B,23);Wait(1150);Off(OUT_BC);
#define turn3 OnRev(OUT_B,30);Wait(4800);Off(OUT_BC);
#define turn4 OnRev(OUT_B,30);Wait(5200);Off(OUT_BC);
#define back OnRev(OUT_C,20);OnRev(OUT_B,28);Wait(3000);Off(OUT_BC);
#define osidasi OnFwd(OUT_BC,100);Wait(100);Off(OUT_BC);
#define arm_down OnFwd(OUT_A,25);Wait(1500);Off(OUT_A);
#define arm_up OnRev(OUT_A,35);Wait(1500);Off(OUT_A);
#define black 30
#define white 60
#define lightgray 50
#define darkgray 39
#define center 45
sub followline_L(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){
if(SENSOR_1<black){
rotate_left;
}else if(SENSOR_1<darkgray){
turn_left;
}else if(SENSOR_1>lightgray){
turn_right;
t0=CurrentTick();
}else if(SENSOR_1<center){
go_straight;
t0=CurrentTick();
}else{
rotate_right;
t0=CurrentTick();
}
}
Off(OUT_BC);
Wait(1000);
}
sub followline_R(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){
if(SENSOR_1<black){
rotate_right;
}else if(SENSOR_1<darkgray){
turn_right;
}else if(SENSOR_1>lightgray){
turn_left;
t0=CurrentTick();
}else if(SENSOR_1<center){
go_straight;
t0=CurrentTick();
}else{
rotate_left;
t0=CurrentTick();
}
}
Off(OUT_BC);
Wait(1000);
}
sub followline_R2(int stop_time)
{
long t0=CurrentTick();
while(CurrentTick()-t0<stop_time){
if(SENSOR_1<black){
rotate_right;
t0=CurrentTick();
}else if(SENSOR_1<darkgray){
turn_right;
t0=CurrentTick();
}else if(SENSOR_1>lightgray){
turn_left;
}else if(SENSOR_1<center){
go_straight2;
t0=CurrentTick();
}else{
rotate_left;
}
}
Off(OUT_BC);
Wait(2000);
}
sub Blackto_White()
{
while(SENSOR_1<lightgray){
OnFwd(OUT_C,25);
OnFwd(OUT_B,25);
}
Off(OUT_BC);
}
sub Whiteto_Black()
{
while(SENSOR_1>darkgray){
OnFwd(OUT_C,25);
OnFwd(OUT_B,25);
}
Off(OUT_BC);
}
sub Blackto_White_R()
{
while(SENSOR_1<darkgray){
OnFwd(OUT_C,25);
OnRev(OUT_B,25);
}
Off(OUT_BC);
}
sub Blackto_White_L()
{
while(SENSOR_1<lightgray){
OnFwd(OUT_B,25);
OnRev(OUT_C,25);
}
Off(OUT_BC);
}
task main()
{
SetSensorLight(S1);
RemoteStartProgram(CONN,"kodomo.nxc");
followline_R(200);
Blackto_White();
followline_L(150);
Blackto_White_R();
followline_R2(150);
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1);
Wait(1000);
arm_up;
turn;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2);
Wait(1000);
followline_R(150);
Blackto_White_L();
followline_L(100);
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(150);
Blackto_White();
turn2;
sakittyo;
arm_down;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1);
Wait(1000);
arm_up;
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2);
Wait(1000);
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
sakittyo;
arm_down;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1);
Wait(1000);
arm_up;
turn3;
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Blackto_White_R();
followline_R(200);
Blackto_White();
turn2;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2);
Wait(1500);
turn4;
arm_down
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_L(200);
Blackto_White();
followline_R(200);
Blackto_White();
followline_L(200);
Blackto_White();
followline_R(200);
Blackto_White();
followline_L(150);
Blackto_White_R();
followline_R2(125);
SendRemoteNumber(CONN,MAILBOX1,SIGNALON1);
Wait(1000);
arm_up;
turn;
followline_R(100);
Blackto_White_L();
followline_L(100);
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
Whiteto_Black();
Blackto_White();
followline_R(200);
Blackto_White();
turn2;
sakittyo;
SendRemoteNumber(CONN,MAILBOX1,SIGNALON2);
Wait(1000);
}
**¥¹¥ì¡¼¥Ö [#yb1b6b06]
#define SIGNALON1 11
#define SIGNALOFF1 12
#define SIGNALON2 13
#define SIGNALOFF2 14
#define CONN 1
task main()
{
int msg;
while(true){
ReceiveRemoteNumber(MAILBOX1,true,msg);
if(msg==SIGNALON1){
OnRev(OUT_A,20);Wait(1000);
}else if(msg==SIGNALOFF1){
Off(OUT_A);
}else if(msg==SIGNALON2){
OnFwd(OUT_A,20);Wait(1000);
}else if(msg==SIGNALOFF2){
Off(OUT_A);
}
}
}
*¤Þ¤È¤á [#b5c75a06]
º£²ó¤Î²ÝÂê¤Ç¤Ï¥×¥í¥°¥é¥ß¥ó¥°¤â¥í¥Ü¥Ã¥È¤ÎºîÀ®¤â¿¤¯¤Î»þ´Ö¤òÈñ¤ä¤·¤¿¡£~
¥í¥Ü¥Ã¥È¤ÎºîÀ®¤Ç¤Ï¡¢¥í¥Ü¥Ã¥È¤Î·Á¡¢¥Ü¡¼¥ë¤ò±¿¤ÖÊýË¡¤Ê¤ÉÍÍ¡¹¤Ê»ö¤ò¹Í¤¨~
ºîÀ®¤·¤¿¡£¥×¥í¥°¥é¥à¤Ç¤Ï¥é¥¤¥ó¥È¥ì¡¼¥¹¤Ï²ÝÂꣲ¤Ç»ÈÍѤ·¤¿¥â¥Î¤ò¤Þ¤ó¤Þ~
»È¤Ã¤Æ¡¢ÏÀÍý¾å¤Ç¤Ï¤¤Á¤ó¤È¥³¡¼¥¹¾å¤ò´°àú¤Ëư¤¯¤â¤Î¤¬ºî¤ì¤¿¤¬¡¢¸½¼ÂÌäÂê~
¤È¤·¤Æ¡¢ÅÅÃÓ¤¬Àڤ줿¤Î¤¬¸¶°ø¤À¤È»×¤¦¤¬¡¢½ÐÎϤ¬¤¹¤°¤Ë¼å¤¯¤Ê¤Ã¤¿¤ê¡¢~
ÊÒÊý¤Î¥â¡¼¥¿¡¼¤¬ÉÔÄ´¤ÇƱ¤¸½ÐÎϤÇľ¿Ê¤µ¤»¤Æ¤â¶Ê¤¬¤Ã¤Æ¤·¤Þ¤¦¤È¤¤¤¦~
¤è¤¦¤Ê¤³¤È¤¬¤¢¤ê¡¢½ÐÎϤäÉÿô¤òËè²óËè²óÄ´À°¤·¤¿¤ê¤¹¤ë¤Î¤Ë¤«¤Ê¤ê~
»þ´Ö¤¬¤«¤«¤Ã¤¿¡£¤À¤¬¡¢ºÇ½ªÅª¤Ë¥í¥Ü¥³¥ó¤Ç¥Ü¡¼¥ë¤ò°ì¤Ä¤·¤«¥È¥ì¡¼¤Ë~
Æþ¤ì¤é¤ì¤Ê¤«¤Ã¤¿¤¬Æó°Ì¤È¤¤¤¦·ë²Ì¤À¤Ã¤¿¤Î¤Ç¡¢¼«Ê¬¤È¤·¤Æ¤Ï°¤¯¤Ï¤Ê¤¤·ë²Ì~
½Ð²ñ¤Ã¤¿¤È»×¤¦¡£
¥Ú¡¼¥¸Ì¾: