Ìܼ¡
#contents
*º£²ó¤Î²ÝÂê¤Ë¤Ä¤¤¤Æ [#j95b5819]
#ref(2015b/Member/kei/Mission2/2015b-mission2.png,¥ë¡¼¥È)
º£²ó¤Î²ÝÂê¤Ï¥ë¡¼¥ÈA¢ªB¤Þ¤¿¤Ï¥ë¡¼¥ÈB¢ªA¤ò¤¦¤Þ¤¯¥é¥¤¥ó¥È¥ì¡¼¥¹¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£&br;

¥ë¡¼¥ÈA¢ªB:AÃÏÅÀ ¢ª Pľ¿Ê ¢ª Qľ¿Ê ¢ª Q±¦ÀÞ ¢ª P±¦ÀÞ ¢ª Qº¸ÀÞ ¢ª Pº¸ÀÞ ¢ª BÃÏÅÀ&br;
¥ë¡¼¥ÈB¢ªA:BÃÏÅÀ ¢ª P±¦ÀÞ ¢ª Q±¦ÀÞ ¢ª Pº¸ÀÞ ¢ª Qº¸ÀÞ ¢ª Qľ¿Ê ¢ª Pľ¿Ê ¢ª AÃÏÅÀ&br;&br;

º£²ó¤Î²ÝÂê¤Ï¤¿¤À¥é¥¤¥ó¥È¥ì¡¼¥¹¤ò¤¹¤ë¤À¤±¤Ç¤Ê¤¯¸òº¹ÅÀ¤Ç¤Îưºî¤¬½ÅÍפǤ¢¤ë¡£&br;
º£²ó¡¢»ä¤Ï¥ë¡¼¥ÈB¢ªA¤òôÅö¤·¤Þ¤¹¡£&br;
[[2015ǯ¸å´ü/²ÝÂꣲ:http://yakushi.shinshu-u.ac.jp/robotics/?2015b%2FMission2]]
*¥í¥Ü¥Ã¥È¤Î¹½Â¤¤Ë¤Ä¤¤¤Æ [#v6451296]
º£²ó¤Ï¥í¥Ü¥Ã¥È¤Ï´ðËÜŪ¤Ë¥Æ¥­¥¹¥È¤Ë¾è¤Ã¤Æ¤¤¤ë¥Ù¡¼¥¹¤Î·¿¤Ç¤ä¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ç³ä°¦¤·¤Þ¤¹¡£
#ref(2015b/Member/kei/Mission2/IMG_4889(1).JPG,50%);
*¥×¥í¥°¥é¥ß¥ó¥°¤Ë¤Ä¤¤¤Æ [#d1fffe12]
º£²ó¤Ï¸òº¹ÅÀ¤ò¤É¤¦Ç§¼±¤·¡¢¥é¥¤¥ó¤ò¥È¥ì¡¼¥¹¤¹¤ë¤È¤­Àþ¤Î¤É¤Á¤é¦¤ò¥È¥ì¡¼¥¹¤¹¤ë¤«¤ò½Å»ë¤·¤ÆÁȤó¤À¡£
¤Þ¤¿¡¢¤Ç¤­¤ë¤À¤±Á᤯¥´¡¼¥ë¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¹©Éפ⤷¤¿¡£

**ÄêµÁÉôʬ [#a7a7053c]
***ÄêµÁÉôʬ¤Î²òÀâ [#w387b37b]
¤³¤ÎÉôʬ¤Ç¤Ï¼ç¤Ë»°¤Ä¤Î»ö¤òÄêµÁ¤·¤Æ¤¤¤ë¡£°ì¤Ä¤Ï¹õ¤ÈÇò¤ò¸«Ê¬¤±¤ë¤¿¤á¤Î¿§¤ÎïçÃͤȥ¹¥Ô¡¼¥É¤Ç¤¢¤ë¡£Æó¤ÄÌܤϥ饤¥ó¥È¥ì¡¼¥¹¤ò¹Ô¤¦¤¿¤á¤Îưºî¤Ç¤¢¤ë¡£»°¤ÄÌܤϸòº¹ÅÀ¤Ç¤Îưºî¤Ç¤¢¤ë¡£²¼¤Î»°¤Ä¤ÎÄêµÁ¤¬¤½¤ì¤Ë¤¢¤¿¤ë¡£
  //²ÝÂê¡§¸òº¹ÅÀ¤Ç£±ÉÃÄä»ß¡¢¥³¡¼¥¹B		BÃÏÅÀ¢ªP±¦ÀÞ¢ªQ±¦ÀÞ¢ªPº¸ÀÞ¢ªQº¸ÀÞ¢ªQľ¿Ê¢ªPľ¿Ê¢ªAÃÏÅÀ

  #define BLACK 35	                     //¤³¤ì°Ê²¼¤ÏÇ»¤¤¹õ
  #define WHITE 50	                     //¤³¤ì°Ê¾å¤ÏÇò
  #define LowSPEED 25
  #define HighSPEED 30
  #define Go OnFwd(OUT_AB,HighSPEED);	     // ľ¿Ê
  #define Go_left OnFwd(OUT_B,LowSPEED);Off(OUT_A);
  #define Go_right OnFwd(OUT_A,LowSPEED);Off(OUT_B);
  #define turn_left OnFwd(OUT_B,LowSPEED);OnRev(OUT_A,HighSPEED);
  #define turn_right OnFwd(OUT_A,LowSPEED);OnRev(OUT_B,HighSPEED);
  #define STEP 1
  #define Chokushin Off(OUT_AB);Wait(1000);Go;Wait(700);break;
  #define Usetu Off(OUT_AB);Wait(1000);turn_right;Wait(700);Go;Wait(300);break;
  #define Sasetu Off(OUT_AB);Wait(1000);turn_left;Wait(500);Go;Wait(300);break;
----

**sub´Ø¿ôÉôʬ¡Ê¸òº¹ÅÀ¤Ç¤Îưºî¡Ë [#b9b87472]

  sub KOUSATEN(int counter) {
    switch (counter) {
        case 0: Usetu;
        case 1: Usetu;
        case 2: Sasetu;
        case 3: Sasetu;
        case 4: Chokushin;
        case 5: Chokushin;
        default: Wait(1);
    }
  }
***¸òº¹ÅÀ¤Ç¤Îưºî¤Î²òÀâ [#v0c861df]
¤³¤Îsub´Ø¿ô¤Ç¸òº¹ÅÀ¤Ç¤Îưºî¤ò·èÄꤷ¤Æ¤¤¤ë¡£²¼¤ÎMain´Ø¿ô¤Ç¸òº¹ÅÀ¤Î¿ô¤ò¿ô¤¨¤ëÉôʬ¤¬¤¢¤ê¡¢¤½¤³¤Ç¸òº¹ÅÀ¤ËÍè¤ë¤¿¤Ó¤Ësub´Ø¿ô¤ò¼Â¹Ô¤·¡¢ºÇ¸å¤Ëcounter¤È¤¤¤¦ÊÑ¿ô¤Ë£±¤ò²Ã¤¨¤ë¤³¤È¤ÇºÆ¤Ósub´Ø¿ô¤ËÆþ¤Ã¤¿»þ¼¡¤Îưºî¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¸òº¹ÅÀ¤Ç¤Îưºî¤Ï¾å¤ÇÄêµÁ¤·¤Æ¤¢¤ë¤È¤ª¤ê¤Ç¤¢¤ë¡£

**Main´Ø¿ô [#fcde30a2]

  task main() {
    SetSensorLight(S1);
    int counter = 0;
    int counter1 = 0;
    int counter2 = 0;
    Off(OUT_AB);
    Wait(1000);
    while (true) {
        if (SENSOR_1 < BLACK) {		       //Ç»¤¤¹õ¤Î¤È¤­&br;

***Main´Ø¿ô¤Î²òÀâ­¡ [#j518088b]
º£¤Þ¤Ç¤ËÄ̤俸òº¹ÅÀ¤Î¿ô¤¬£°¡¢£±¡¢£µ¡¢£¶¤Î¤É¤ì¤«¤Ç¤¢¤ë¤È¤­¤«¤ÄÇ»¤¤Àþ¤Î¾å¤Ë¤¤¤ë¤È¤­¤Ë¤³¤ì¤ò¼Â¹Ô¤¹¤ë¡£¤³¤Î»þ¤Ï¥é¥¤¥ó¤Î±¦Â¦¤Ë¤¤¤ë¤Î¤Çº¸Êý¸þ¤Ø¿Ê¤à¡£¤½¤·¤Æcounter1¤Ë£±¤ò²Ã¤¨¤ë¡£¤³¤ì¤Ë¤è¤Ã¤ÆÇ»¤¤Àþ¤Î¾å¤Ë¤¤¤ë»þ´Ö¤ò¥«¥¦¥ó¥È¤¤¤Æ¤¤¤ë¡£¤³¤Îcounter1¤¬°ìÄê°Ê¾å¤ÎÃͤˤʤä¿»þ¤Ë¸òº¹ÅÀ¤Ç¤¢¤ë¤Èǧ¼±¤·¤Æ¤¤¤ë¡£

            if (counter == 0 || counter == 1 || counter == 5 || counter == 6) {
                Go_left;								//º¸¤Ø
                counter1++;
----
***Main´Ø¿ô¤Î²òÀâ­¢ [#ife210e1]
º£¤Þ¤Ç¤ËÄ̤俸òº¹ÅÀ¤Î¿ô¤¬Æó¤Ä¤Ç¤¢¤ë¤È¤­¤«¤ÄÇ»¤¤¹õÀþ¤Î¾å¤Ç¤¢¤ë¤È¤­¤Ë¤³¤ì¤ò¼Â¹Ô¤¹¤ë¡£&br;
¤³¤³¤Ç¤Ïcounter2¤È¤¤¤¦ÊÑ¿ô¤òÊ̤ËÍѰդ·¤Æcounter2¤ÎÃͤ¬°ìÄê°Ê²¼¤Î»þ¤Ëcounter1¤ÎÃͤò½é´ü²½¤·¤Æ¤¤¤ë¡£µÕ¤Î¾ì¹ç¤Ïcounter1¤Ë£±¤ò²Ã¤¨¤ë¡£Æó¤Ä´Ø¿ô¤òÍѰդ·¤Æ¤¤¤ëÍýͳ¤Ïcounter1¤ÎÃͤ¬£²£µ£°°Ê¾å¤Î»þ¤Ë¸òº¹ÅÀ¤Èǧ¼±¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬»°¤ÄÌܤθòº¹ÅÀÁ°¤Ç¤Ï¤½¤ì¤Ç¤Ï¤¦¤Þ¤¯¤¤¤«¤Ê¤«¤Ã¤¿¤¿¤á¤Ç¤¢¤ë¡£
            } else if (counter == 2) {
                Go_right;								//±¦¤Ø
                counter2++;
                if (counter2 < 5000) {
                	counter1 = 0;
                } else {
                	counter1++;
                }
----
***Main´Ø¿ô¤Î²òÀâ­£ [#g54d2652]
º£¤Þ¤Ç¤ËÄ̤俸òº¹ÅÀ¤Î¿ô¤¬£³¤Î»þ¤«¤Ä¹õ¤¤Àþ¤Î¾å¤Ç¤¢¤ë¤È¤­¤Ë¤³¤Îưºî¤ò¹Ô¤¦¡£¤³¤³¤Ç¤âcouter1¤Ë¤³¤Îưºî¤ò¹Ô¤¦¤¿¤Ó¤Ë£±¤ò²Ã¤¨¤ë¡£
            } else if(counter == 3) {
            	Go_right;
            	counter1++;
----
***Main´Ø¿ô¤Î²òÀâ­¤ [#nf2ac057]
Ä̤俸òº¹ÅÀ¤Î¿ô¤¬¾åµ­°Ê³°¤¹¤Ê¤ï¤Á£´¤Î»þ¤«¤Ä¹õ¤¤Àþ¤Î¾å¤Î¤È¤­¤Ë¤³¤Îưºî¤ò¹Ô¤¦¡£¤³¤ì¤âƱÍͤËcounter1¤Ë£±¤ò²Ã¤¨¤ë¡£
            } else {
                turn_right;
                counter1++;
----
***Main´Ø¿ô¤Î²òÀâ­¥ [#pbcda0ed]
¤³¤³¤Ç¤Ï¾å¤Ç¿ô¤¨Â³¤±¤¿counter1¤¬£²£µ£°¤òͤ¨¤¿¤È¤­¤Îưºî¤Ç¤¢¤ë¡££²£µ£°¤òͤ¨¤¿¾ì¹ç¤Ï¸òº¹ÅÀ¤Ç¤¢¤ë¤ÈȽÃǤ·¤ÆÆ°ºî¤ò¹Ô¤¦¡£¶ñÂÎŪ¤Ë¤Ï¾å¤Çµ­¤·¤¿sub´Ø¿ô¤ò¼Â¹Ô¤¹¤ë¡£ºÇ½é¤Ïcounter¤ÎÃͤϣ°¤Ç¤¢¤ë¤«¤é¾å¤ÎSub´Ø¿ô¤Ç¤Ï±¦ÀÞ¤ò¹Ô¤¦¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¤½¤·¤Æcounter¤Ë£±¤ò²Ã¤¨¤ë¡£¤³¤ì¤¬º£¤Þ¤Ç¤ËÄ̤俸òº¹ÅÀ¤Î¿ô¤Ë³ºÅö¤¹¤ë¡£¤½¤·¤Æcounter1¤ÎÃͤò½é´ü²½¤¹¤ë¤³¤È¤Ç¤Þ¤¿¥é¥¤¥ó¥È¥ì¡¼¥¹¤ËÌá¤ë¡£¤¿¤À¤·¥é¥¤¥ó¤Î±¦Â¦¤«º¸Â¦¤«¤Ç¥é¥¤¥ó¥È¥ì¡¼¥¹¤Ç¤Îư¤­¤¬µÕ¤Ë¤Ê¤ë¤¿¤á¤½¤ì¤¾¤ì¤Î¸òº¹ÅÀ¤òÄ̲á¸å¤Îưºî¤¬ÍѰդµ¤ì¤Æ¤¤¤ë¡£
            } if (counter1 > 250) {
            	KOUSATEN(counter);
            	counter++;
            	counter1 = 0;
            }
----
***Main´Ø¿ô¤Î²òÀâ­¦ [#hf79f6b3]
BLACK¤è¤ê¤ÏÌÀ¤ë¤¤¤¬WHITE¤è¤ê°Å¤¤¾ì½ê¤Ï¶­³¦ÀþÉÕ¶á¤Ç¤¢¤ë¤ÈȽÃǤ¹¤ë¡£¶­³¦ÀþÉÕ¶á¤Ç¤ÏÁ°¿Ê¤ò¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¾¯¤·¤Ç¤â¥¿¥¤¥à¤ò½Ì¤á¤é¤ì¤ë¤è¤¦¤Ë¹©Éפò¤·¤Æ¤¤¤ë¡£
        } else if (SENSOR_1 < WHITE) {	   //¶­³¦ÉÕ¶á¤Ê¤é
            Go;							   //ľ¿Ê
            counter1 = 0;
----
***Main´Ø¿ô¤Î²òÀâ­§ [#x35f0106]
¤³¤³¤ÏÇò¤¤Éôʬ¤Ç¤Îưºî¤Ê¤Î¤ÇÀþ¤ò¸«¼º¤Ã¤Æ¤«¤éÀþ¤òõ¤¹Æ°ºî¤ò¹Ô¤¦¤È¤³¤í¤Ç¤¢¤ë¡£¾å¤Î¹õÀþ¾å¤Ç¤ÎưºîƱÍͤ˥饤¥ó¤Î±¦Â¦¤«º¸Â¦¤«¤Çưºî¤¬°Û¤Ê¤ë¤Î¤Ç¤½¤ì¤¾¤ì¤Î¸òº¹ÅÀ¤òÄ̲ᤷ¤¿¸å¤Çưºî¤¬°Û¤Ê¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
        } else {					       //Çò¤Î¤È¤­
            if (counter == 0 || counter == 1) {
            	Go_right;							//±¦¤Ø
            	counter1 = 0;
            } else if (counter == 2 || counter == 3) {
            	turn_left;							//º¸¤Ø
            	counter1 = 0;
            } else if (counter == 5 || counter == 6){
            	Go_right;
            } else {
            	turn_left;
            	counter1 = 0;
            }
        }
        Wait(STEP);
    }
  }
----
***¤Þ¤È¤á [#s181151b]
¤³¤Î¥×¥í¥°¥é¥à¤Ç¤Ï´ðËÜŪ¤Ë¹õ¤¤Àþ¤Î¾å¤Ë¤¤¤ë¤È¤­¤Ëcounter1¤Ë£±¤ò²Ã¤¨¤ëưºî¤ò·«¤êÊÖ¤·¡¢°ìÄê°Ê¾å¤Ë¤Ê¤Ã¤¿¤é¸òº¹ÅÀ¤Ç¤¢¤ë¤ÈȽÃǤ·¤Æ±¦ÀÞ¡¢º¸ÀÞ¡¢Ä¾¿Ê¤Î¤É¤ì¤«¤ò¹Ô¤¤counter¤Ë£±¤ò²Ã¤¨¤ë¡£counter¤Ïº£¤Þ¤Ç¤ËÄ̤俸òº¹ÅÀ¤Î¿ô¤òµ­Ï¿¤¹¤ëÊÑ¿ô¤Ç¤¢¤ë¡£

**¥×¥í¥°¥é¥à¤Î¹©É×ÅÀ [#w7514f8b]
º£²ó¤Î¥×¥í¥°¥é¥à¤Ç¤Î¹©É×ÅÀ¤Ï¸òº¹ÅÀ¤Î¿ô¤ò¿ô¤¨¤Æ¤½¤Î¿ô¤Ë±þ¤¸¤Æ¥µ¥Ö¥ë¡¼¥Á¥ó¤Îµóư¤òÊѤ¨¤¿¤³¤È¤Ç¤¢¤ë¡£
¤Þ¤¿Æó²óÌܤθòº¹ÅÀ¤ò²ó¤Ã¤¿¸å¤Ç¸íºîư¤¬µ¯¤­¤Ê¤¤¤è¤¦¤Ë´Ø¿ô¤Ç¥«¥¦¥ó¥È¤¹¤ë¤³¤È¤ò¤·¤¿¡£
¤µ¤é¤Ë¸òº¹ÅÀ¤ò±Û¤¨¤¿»þ¤Ë¥«¡¼¥Ö¤Î³°Â¦¤ò¥é¥¤¥ó¥È¥ì¡¼¥¹¤¹¤ë¤è¤¦¤Ë°Üư¤ò¤·¥«¡¼¥Ö¤ò¶Ê¤¬¤ë»þ¤ËÊÒÊý¤Î¥¿¥¤¥ä¤À¤±²ó¤¹¤«Î¾Êý¤ò²ó¤¹¤«¤Þ¤¿¡¢Çò¤È¹õ¤Î»þ¤Î²óžÊý¸þ¤òÊѤ¨¤ë¤³¤È¤â¹Ô¤Ã¤¿¡£
¤Þ¤¿Æó²óÌܤθòº¹ÅÀ¤ò²ó¤Ã¤¿¸å¤Ï¸íºîư¤¬µ¯¤­¤Ê¤¤¤è¤¦¤ËÊ̤δؿô¤Ç¥«¥¦¥ó¥È¤¹¤ë¤³¤È¤ò¤·¤¿¡£
¤µ¤é¤Ë¸òº¹ÅÀ¤ò±Û¤¨¤¿»þ¤Ë¤Ç¤­¤ë¤À¤±¥«¡¼¥Ö¤Î³°Â¦¤ò¥é¥¤¥ó¥È¥ì¡¼¥¹¤¹¤ë¤è¤¦¤Ë°Üư¤ò¤·¥«¡¼¥Ö¤ò¶Ê¤¬¤ë»þ¤ËÊÒÊý¤Î¥¿¥¤¥ä¤À¤±²ó¤¹¤«Î¾Êý¤ò²ó¤¹¤«¤Þ¤¿¡¢Çò¤È¹õ¤Î»þ¤Î²óžÊý¸þ¤òÊѤ¨¤ë¤³¤È¤â¹Ô¤Ã¤¿¡£

*´¶Áۤȹͻ¡ [#u19249aa]
**¹Í»¡ [#ze267323]
º£²ó¤Î²ÝÂê¤Ç¤ÎºÇ¸å¤Þ¤Ç¤ÎÀ®¸ùΨ¤Ï¤¢¤Þ¤ê¹â¤¯¤Ê¤«¤Ã¤¿¡£¥¿¥¤¥à¤âÂçÂΣ³Ê¬¤°¤é¤¤¤Ç¤¢¤Ã¤¿¡£À®¸ùΨ¤¬Ä㤤Í×°ø¤Î°ì¤Ä¤Ë»æ¤òÀÞ¤ê¶Ê¤²¤Æ¤·¤Þ¤Ã¤¿¤³¤È¤¬¤¢¤ë¤È»×¤¦¡£¤â¤·¼¡¤Îµ¡²ñ¤¬¤¢¤Ã¤¿¤é»æ¤ò´Ý¤á¤ë¤Ê¤É¤Î¹©Éפò¤·¤¿¤¤¡£
**´¶ÁÛ [#p7482e50]
º£²ó¤Î²ÝÂê¤Ç¤ÏËÜÅö¤Ï£µÃʳ¬¤Ç¥é¥¤¥ó¤òǧ¼±¤·¤Æ³ê¤é¤«¤Ëư¤¯¤è¤¦¤Ë¤·¤«¤¿¤«¤Ã¤¿¤¬»æ¤òÀÞ¤ê¶Ê¤²¤Æ¤·¤Þ¤Ã¤¿¤³¤È¤ÈÀþ¤ÎÇ»¤µ¤¬ÉԶѰì¤Ç¤¢¤Ã¤¿¤¿¤áÉÔ²Äǽ¤Ç¤¢¤Ã¤¿¡£¼¡¤Îµ¡²ñ¤¬¤¢¤ì¤Ð¤½¤³¤ò²þÁ±¤·¥×¥í¥°¥é¥à¤â¤è¤ê²þÁ±¤·¤ÆÁ᤯¥´¡¼¥ë¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿¤¤¡£¤Þ¤¿¤³¤Î¥ß¥Ã¥·¥ç¥ó¤Î¸åȾ¤ÇÅÅÃÓ¤¬¸º¤Ã¤Æ¤­¤Æ¤¦¤Þ¤¯Æ°¤«¤Ê¤¯¤Ê¤ê¸ò´¹¤ò¤·¤¿¤éµÕ¤Ëư¤­¤¹¤®¤Æ¤Þ¤¿Ä´À°¤·Ä¾¤¹¤³¤È¤Ë¤Ê¤ê¤È¤Æ¤â¶ìÏ«¤·¤¿¡£¼¡¤Î²ÝÂê¤Ï»þ´Ö¤Ç¤Ï¤Ê¤¯¥â¡¼¥¿¡¼¤Î²óž¤Ê¤É¤òÍøÍѤ·¤¿¥×¥í¥°¥é¥à¤·¤Æ¤¤¤­¤¿¤¤¤È»×¤¦¡£²óž¿ô¤ÇÀ©¸æ¤¹¤ì¤Ð°Üưµ÷Î¥¤¬ÊѤï¤é¤Ê¤¤¤¿¤á¤Ç¤¢¤ë¡£

¥È¥Ã¥×   ÊÔ½¸ º¹Ê¬ ÍúÎò źÉÕ Ê£À½ ̾Á°Êѹ¹ ¥ê¥í¡¼¥É   ¿·µ¬ °ìÍ÷ ¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS