Ìܼ¡
#contents

*²ÝÂê [#b3508a12]
¹õ¤¤Àþ¤Ë±è¤Ã¤ÆÆ°¤­¡¢»æ¥³¥Ã¥×¤ò°Üư¤µ¤»¤ë¥í¥Ü¥Ã¥È¤òÀ½ºî¤¹¤ë¡£
&ref(2017b/Member/Taka/Mission2/2017b-mission2.png,640x480,¥³¡¼¥¹);

**¥³¡¼¥¹ [#k32f7ed7]
»ä¤ÏÂ裲¥³¡¼¥¹¤òÁªÂò¤·¤¿¡£

D¤ò¥¹¥¿¡¼¥È¢ªC¤òľ¿Ê¢ªB¤òº¸ÀÞ¢ªP¤òº¸ÀÞ(°ì»þÄä»ß)¢ªQ¤òľ¿Ê¢ªR¤òº¸ÀÞ

¢ªF¤òº¸ÀÞ¢ªS¤òľ¿Ê(°ì»þÄä»ß)¢ªYÃÏÅÀ¤Î»æ¥³¥Ã¥×¤ò¼èÆÀ¤·¤Æ¥³¡¼¥¹¤ËÌá¤ë¢ªS¤òľ¿Ê(°ì»þÄä»ß)

¢ªQ¤òº¸ÀÞ(°ì»þÄä»ß)¢ªR¤òľ¿Ê¢ªXÃÏÅÀ¤Ë»æ¥³¥Ã¥×¤òÃÖ¤¤¤Æ¥³¡¼¥¹¤ËÌá¤ë¢ªP¤òº¸ÀÞ¢ªB¤òº¸ÀÞ(°ì»þÄä»ß)¢ªAÃÏÅÀ¤Ø(¥´¡¼¥ë)


¥é¥¤¥ó¤Ï¿¿¤óÃæ¤ÎÊý¤¬¹õ¤¬Ç»¤¯¤Ê¤ë¤è¤¦¤ËºîÀ®¤·¤¿¡£
*¥í¥Ü¥Ã¥È¤ÎÀâÌÀ [#m72a0782]

**¥í¥Ü¥Ã¥ÈÁ´ÂÎ [#y11022aa]
&ref(2017b/Member/Taka/Mission2/1515606271846.jpg,320x240,¥í¥Ü¥Ã¥ÈÁ´ÂÎ);

´ðËÜŪ¤Ë¤Ï¾®²ó¤ê¤¬¤Ê¤ë¤Ù¤¯¤­¤¯¤è¤¦¤Ë¥í¥Ü¥Ã¥È¤òºîÀ®¤·¤¿¡£¥í¥Ü¥Ã¥È¤ÎËÜÂÎÉôʬ¤Ï¡¢ºÇ½é¤Ëºî¤Ã¤¿¥í¥Ü¥Ã¥È¤«¤é¥³¥ó¥È¥í¡¼¥é¤ò¡¢¥í¥Ü¥Ã¥È¤Î½Å¿´¤Î¤³¤È¤ò¹Í¤¨¤Æ¿åÊ¿¤ËÉÕ¤±ÊѤ¨¤¿¡£¥é¥¤¥È¤ÎÉôʬ¤Ï¡¢ÀâÌÀ½ñ¤ËºÜ¤Ã¤Æ¤¤¤¿¤â¤Î¤è¤ê¾¯¤·ËÜÂΤ˶᤯¤Ê¤ë¤è¤¦¤Ë¹©Éפ·¤¿¡£¤³¤Î¥í¥Ü¥Ã¥È¤Ë»æ¥³¥Ã¥×¤ò¤È¤ë¤¿¤á¤Îµ¡¹½¤ò¾åÁ°Êý¤Î¿¿¤óÃæ¤Ë¤Ä¤±¤¿¡£

**»æ¥³¥Ã¥×¤ò¤È¤ëµ¡¹½ [#pdd59be6]
&ref(2017b/Member/Taka/Mission2/1515606249111.jpg,320x240,»æ¥³¥Ã¥×¥¢¡¼¥à);
¢«²¼¤í¤¹Á°

»æ¥³¥Ã¥×¤ò¼è¤ë¤¿¤á¤Î¥¢¡¼¥à¤Ï¡¢ÏȤò²¼¤í¤·¤Æ»æ¥³¥Ã¥×¤ò¼è¤ë¤è¤¦¤Êµ¡¹½¤Ë¤·¤¿¡£¤³¤³¤Ç¹©Éפ·¤¿¤Î¤Ï¡¢¥í¥Ü¥Ã¥È¤Îº¸Á°Êý¤Ë¤¢¤ëL»ú¤Î¥Ð¡¼¤Ç¤¹¡£¤³¤Î¥Ð¡¼¤Ç»æ¥³¥Ã¥×¤ò¤È¤é¤¨¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢³Î¼Â¤ËÏÈÆâ¤ËÆþ¤ë¤è¤¦¤Ë¤Ç¤­¤¿¡£¤Þ¤¿¡¢»æ¥³¥Ã¥×¤È¥»¥ó¥µ¡¼¤¬°ÜÆ°Ãæ¤Ê¤É¤Ë¤Ö¤Ä¤«¤ë¤³¤È¤â¤³¤Î¥Ð¡¼¤ÇËɤ°¤³¤È¤¬½ÐÍè¤Æ¤¤¤ë¡£

&ref(2017b/Member/Taka/Mission2/1515606229654.jpg,240x320,»æ¥³¥Ã¥×¥¢¡¼¥à);
¢«²¼¤í¤·¤¿¸å

*¥×¥í¥°¥é¥à¤ÎÀâÌÀ [#n48c211d]

&ref(2017b/Member/Taka/Mission2/¥í¥Ü¡¡»ñÎÁ.png,240x320,ÌÀ¤ë¤µ¤Î¿ôÃÍ);

Àþ¤ÎÌÀ¤ë¤µ¤äÈϰϤϤ³¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢Ä̾ï»þ¡ÊľÀþ¤ä´Ë¤¤¥«¡¼¥Ö¤Ê¤É¡Ë¤Ï£³Ãʳ¬¡¢µÞ¥«¡¼¥Ö¤Ç¤Ï£µÃʳ¬¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£

¥¹¥Ô¡¼¥É¤äïçÃͤòÄêµÁ¤·¤¿¡£¥¿¥¤¥ä¤Î¥¹¥Ô¡¼¥É¤Ï¥â¡¼¥¿¡¼¤Ë¤è¤Ã¤Æ¶Ï¤«¤Ë¥º¥ì¤¬¤¢¤Ã¤¿¤Î¤Ç¤½¤ì¤¾¤ìÍѰդ·¤¿¡£
 #define speedA 38  //±¦¥¿¥¤¥ä¤Î¥¹¥Ô¡¼¥É
 #define speedB 36  //º¸¥¿¥¤¥ä¤Î¥¹¥Ô¡¼¥É
 #define THRESHOLD 50  //ïçÃÍ
 #define STEP 1  //Wait¤Î°ú¿ô
 #define sA2 speedA/2  //¥¹¥Ô¡¼¥É¤òÃÙ¤¯¤¹¤ë»þ¤Ë»ÈÍÑ
 #define sB2 speedB/2  //¥¹¥Ô¡¼¥É¤òÃÙ¤¯¤¹¤ë»þ¤Ë»ÈÍÑ

¥µ¥Ö¥ë¡¼¥Á¥ó¤ÇÁ°¿Ê¤äÀû²ó¤Ê¤É¤Î´ðËÜÆ°ºî¡¢¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥×¥í¥°¥é¥à¡¢»æ¥³¥Ã¥×¤ò¼è¤ë¡¦Êü¤¹¥×¥í¥°¥é¥à¤òºîÀ®¤·¤¿¡£

 sub go_forward(long x,long y)  //Á°¿Ê
 {
     OnFwd(OUT_A,speedA-x);OnFwd(OUT_B,speedB-y);
 }
 
 sub go_right1(long x,long y)  //±¦¥«¡¼¥Ö
 {
     OnFwd(OUT_B,speedB-y);Off(OUT_A);
 }
 
 sub go_left1(long x,long y)  //º¸¥«¡¼¥Ö
 {
     OnFwd(OUT_A,speedA-x);Off(OUT_B);
 }
 
 sub go_right2(long x,long y)  //±¦Àû²ó
 {
     OnFwd(OUT_A,-speedA-x);OnFwd(OUT_B,speedB-y);
 }
 
 sub go_left2(long x,long y)  //º¸Àû²ó
 {
     OnFwd(OUT_A,speedA-x);OnFwd(OUT_B,-speedB-y);
 }
 
¥³¡¼¥¹¤Î¾ì½ê¤Ë¤è¤Ã¤Æ¸òº¹ÅÀȽÄê¤Î»þ´Ö¤Ê¤É¤ÎºÙ¤«¤¤¤È¤³¤í¤òÊѤ¨¤¿¤Î¤Ç¡¢Ä̾ï»þ¤ÈµÞ¥«¡¼¥Ö¤ò´Þ¤á¤Æ£¶¤Ä¤Î¥×¥í¥°¥é¥à¤òÍѰդ·¤¿¡£Æ°ºî¤¬½ª¤ï¤ë¤È²»¤¬ÌĤë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥×¥í¥°¥é¥à¤Ç»È¤ï¤ì¤Æ¤¤¤ëÊÑ¿ô£î¤ÏϢ³¤·¤ÆÆ±¤¸ÌÀ¤ë¤µ¤ÎÈϰϤΤȤ³¤í¤òÄ̤ë²ó¿ô¤Ç¤¢¤ë¡£Î㤨¤Ð¡¢µÞ¥«¡¼¥Ö¡Êº¸ÀÞ¡Ë¤Î¥×¥í¥°¥é¥à¤Ç¤Ïgo_forward¤ÎÈϰϤÇϢ³300²ó¤Ë㤹¤ë¤È¤³¤Î¥×¥í¥°¥é¥à¤Ï½ªÎ»¤¹¤ë¡£Ä̾ï»þ­¢¤Ç¤Ïgo_left2¤ÎÈϰϡÊÇ»¤¤¹õ¡Ë¤ÇϢ³250²ó¤Ë㤹¤ë¤È¥×¥í¥°¥é¥à¤¬½ªÎ»¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£n=n+1¤Î¤¢¤ë¤È¤³¤í¤Ïưºî¤ò¹Ô¤¦ÅÙn¤¬¥«¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤­¡¢n¤¬»ØÄꤵ¤ì¤¿²ó¿ô¤Ë㤹¤ë¤È¥×¥í¥°¥é¥à½ªÎ»¤·¡¢n=0¤Ï°ìÅÙÆ°ºî¤¹¤ë¤Èn¤¬¥ê¥»¥Ã¥È¤µ¤ì¤ë¤È¤¤¤¦°ÕÌ£¤Ç¤¢¤ë¡£¤³¤ì¤Ë¤è¤Ã¤Æ¸òº¹ÅÀȽÄê¤ò¹Ô¤Ã¤Æ¤¤¤ë¡£

µÞ¥«¡¼¥Ö¤Ï±¦ÀޤȺ¸ÀÞ¤Çʬ¤«¤ì¤Æ¤¤¤ë¡£

 sub L_Turn1(long x,long y)  //µÞ¥«¡¼¥Ö¡Êº¸ÀÞ¡Ë
 {
     long n = 0;  //³¤±¤ÆÄ¾¿Ê¤·¤¿²ó¿ô
 
     while (n < 300){
         if (SENSOR_1 < THRESHOLD -17) {
             go_left2(x,y);n=0;                  //n¤ò¥ê¥»¥Ã¥È
         } else if (SENSOR_1 < THRESHOLD -13) {
             go_left1(x,y);
         } else if (SENSOR_1 < THRESHOLD-9) {
             go_forward(x,y);n=n+1;              //n¤ò+1¥«¥¦¥ó¥È
         } else if (SENSOR_1 < THRESHOLD +15) {
             go_right1(x,y);
         } else {
             go_right1(x,y);n=0;                 //n¤ò¥ê¥»¥Ã¥È
         }
         Wait(STEP);
     }
 
     PlayTone(523,50);
 }
 
 sub L_Turn2(long x,long y)  //µÞ¥«¡¼¥Ö¡Ê±¦ÀÞ¡Ë
 {
     long n = 0;  //³¤±¤ÆÄ¾¿Ê¤·¤¿²ó¿ô
 
     while (n < 300){
         if (SENSOR_1 < THRESHOLD -17) {
             go_left2(x,y);n=0;                  //n¤ò¥ê¥»¥Ã¥È
         } else if (SENSOR_1 < THRESHOLD -13) {
             go_left1(x,y);
         } else if (SENSOR_1 < THRESHOLD-9) {
             go_forward(x,y);n=n+1;              //n¤ò+1¥«¥¦¥ó¥È
         } else if (SENSOR_1 < THRESHOLD +15) {
             go_right1(x,y);
         } else {
             go_right2(x,y);n=0;                 //n¤ò¥ê¥»¥Ã¥È
         }
         Wait(STEP);
     }
 
     PlayTone(523,50);
 }

Ä̾ï»þ¤Ë´Ø¤·¤Æ¤Ï¡¢­¡¤¬Ä¾Àþ¡¢­¢¤¬±ß¡¢­£¤¬£²¤Ä¤ÎµÞ¥«¡¼¥Ö¤Î¤Ä¤Ê¤®¤ÎľÀþ¡¢­¤¤¬»æ¥³¥Ã¥×¤ò¼è¤ê¤Ë¹Ô¤¯¤¿¤á¤Ë»ß¤Þ¤ë»þ¤Çʬ¤«¤ì¤Æ¤¤¤ë¡£¸òº¹ÅÀ¤ÏϢ³¤Ç¹õ¤¬Â³¤­¡¢n¤¬»ØÄê²ó¿ô¤Ë㤹¤ë¤³¤È¤ÇȽÄꤷ¤Æ¤¤¤ë¡£­¡¤È­¢¤Ï¤Û¤È¤ó¤ÉƱ¤¸¤è¤¦¤Ê¥×¥í¥°¥é¥à¤À¤¬¡¢Ä¾Àþ¤«¤é±ß¤Î¸òº¹ÅÀ¤ó¡¦±ß¤«¤éľÀþ¤Î¸òº¹ÅÀ¤¬ÉáÄ̤θòº¹ÅÀ¤Î»þ¤È¶Ï¤«¤À¤¬£î¤Î»ØÄꤹ¤ëÃͤ˰㤤¤¬¤¢¤Ã¤¿¤Î¤Ç¡¢¥×¥í¥°¥é¥à¤òʬ¤±¤¿¡£

 sub L_Straight1(long x,long y)  //Ä̾ï»þ­¡¡ÊľÀþµÚ¤Óľ³Ñ¤Î¸òº¹ÅÀ¡Ë
 {
     long n =0;  //³¤±¤Æº¸Àû²ó¤·¤¿¡Ê¹õ¤Ë¤Ê¤Ã¤¿¡Ë²ó¿ô
 
     while (n < 250){
         if (SENSOR_1 < THRESHOLD -13) {
             go_left2(x,y);n=n+1;            //n¤ò+1¥«¥¦¥ó¥È
         } else if (SENSOR_1 < THRESHOLD) {
             go_forward(x,y);
         } else {
             go_right1(x,y);n=0;             //n¤ò¥ê¥»¥Ã¥È
         }
         Wait(STEP);
     }
 
     PlayTone(523,50);
 }
 
 sub L_Straight2(long x,long y)  //Ä̾ï»þ­¢¡Ê±ß¡Ë
 {
     long n =0;  //³¤±¤Æº¸¥«¡¼¥Ö¤·¤¿¡Ê¹õ¤Ë¤Ê¤Ã¤¿¡Ë²ó¿ô
 
     while (n < 250){
         if (SENSOR_1 < THRESHOLD -13) {
             go_left1(x,y);n=n+1;            //n¤ò+1¥«¥¦¥ó¥È
         } else if (SENSOR_1 < THRESHOLD) {
             go_forward(x,y);
         } else {
             go_right1(x,y);n=0;             //n¤ò¥ê¥»¥Ã¥È
         }
         Wait(STEP);
     }
 
     PlayTone(523,50);
 }
 
 sub L_Straight3(long x,long y)  //Ä̾ï»þ­£¡ÊµÞ¥«¡¼¥Ö´Ö¤ÎľÀþ¡Ë
 {
     long n =0;  //³¤±¤Æ±¦¥«¡¼¥Ö¤·¤¿¡ÊÇò¤Ë¤Ê¤Ã¤¿¡Ë²ó¿ô
 
     while (n < 300){
         if (SENSOR_1 < THRESHOLD -13) {
             go_left2(x,y);n=0;              //n¤ò¥ê¥»¥Ã¥È
         } else if (SENSOR_1 < THRESHOLD) {
             go_forward(x,y);
         } else {
             go_right1(x,y);n=n+1;           //n¤ò+1¥«¥¦¥ó¥È
         }
         Wait(STEP);
     }
 
     PlayTone(523,50);
 }
 
 sub L_Straight4(long x,long y)  //Ä̾ï»þ­¤¡Ê»æ¥³¥Ã¥×¤ò¼è¤ê¤Ë¹Ô¤¯½àÈ÷¡Ë
 { 
     long n =0;  //³¤±¤ÆÄ¾¿Ê¤·¤¿¡Ê¹õ¤Ë¤Ê¤Ã¤¿¡Ë²ó¿ô
 
     while (n < 300){
         if (SENSOR_1 < THRESHOLD -13) {
             go_forward(x,y);n=n+1;          //n¤ò+1¥«¥¦¥ó¥È
         } else if (SENSOR_1 < THRESHOLD) {
             go_forward(x,y);n=n+1;          //n¤ò+1¥«¥¦¥ó¥È
         } else {
             go_right1(x,y);n=0;             //n¤ò¥ê¥»¥Ã¥È
         }
         Wait(STEP);
     }
 
     PlayTone(523,50);
 }

n¤Ë¤Ä¤¤¤Æ²¿¤â½ñ¤«¤ì¤Æ¤¤¤Ê¤¤¤È¤³¤í¤Ïn¤ò¥ê¥»¥Ã¥È¤â¥«¥¦¥ó¥È¤â¤¹¤ëɬÍפ¬¤Ê¤¤¤È»×¤Ã¤¿¤«¤é¤À¡£Î㤨¤Ð¡¢Ä̾ï»þ­¡¤Ç¤Ïgo_forward¤Î¤È¤³¤í¤Çn¤Ë¤Ä¤¤¤Æ²¿¤â¤Ê¤¤¡£¾åµ­¤Ë¤â¤¢¤ëÄ̤ꡢ¹õ¤¤¤È¤³¤Ç¤Î±¦Àû²ó¤Î²ó¿ô¤ò¥«¥¦¥ó¥È¤¹¤ë¤³¤È¤Ç¸òº¹ÅÀȽÄê¤ò¤·¤Æ¤¤¤ë¤Î¤À¤¬¡¢¸òº¹ÅÀ¤Çľ¿Ê¤ò¤·¤Æ¤â¹õ¤¤¤È¤³¤í¤Ø¹Ô¤­±¦Àû²ó¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£²¼¤Î³¨¤ÎÌð°õ¤Î¤è¤¦¤Ëưºî¤¹¤ëÃæ¤Ç¤Î±¦Àû²ó¤Î²ó¿ô¤ò¥«¥¦¥ó¥È¤¹¤ë¤Î¤À¤¬¡¢ÅÓÃæ¤Çľ¿Ê¤¬Æþ¤Ã¤Æ¤·¤Þ¤Ã¤Æ¤â¹õ¤¤¤È¤³¤í¤Ç¤Þ¤¿±¦Àû²ó¤ò¤·¤Æ¥«¥¦¥ó¥È¤¬Â³¤±¤é¤ì¤ë¡£Ä¾¿Ê¤Çn¤ò¥ê¥»¥Ã¥È¤·¤Æ¤·¤Þ¤¦¤È¡¢¤½¤ì¤Þ¤Ç¤Î±¦Àû²ó¤Î¥«¥¦¥ó¥È¤¬¤Ê¤¯¤Ê¤ê¡¢¥×¥í¥°¥é¥à¤¬Â³¤­¸òº¹ÅÀȽÄ꤬½ÐÍè¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£¤½¤¦¤¤¤¦°Õ¿Þ¤Çn¤Ë¤Ä¤¤¤Æ²¿¤â¤Ê¤¤¤È¤³¤í¤¬¤¢¤ë¡£Ä̾ï»þ­¡°Ê³°¤Ë¤ª¤¤¤Æ¤âƱÍͤÎÍýͳ¤À¡£
n¤Ë¤Ä¤¤¤Æ²¿¤â½ñ¤«¤ì¤Æ¤¤¤Ê¤¤¤È¤³¤í¤Ïn¤ò¥ê¥»¥Ã¥È¤â¥«¥¦¥ó¥È¤â¤¹¤ëɬÍפ¬¤Ê¤¤¤È»×¤Ã¤¿¤«¤é¤À¡£Î㤨¤Ð¡¢Ä̾ï»þ­¡¤Ç¤Ïgo_forward¤Î¤È¤³¤í¤Çn¤Ë¤Ä¤¤¤Æ²¿¤â¤Ê¤¤¡£¾åµ­¤Ë¤â¤¢¤ëÄ̤ꡢ¹õ¤¤¤È¤³¤Ç¤Î±¦Àû²ó¤Î²ó¿ô¤ò¥«¥¦¥ó¥È¤¹¤ë¤³¤È¤Ç¸òº¹ÅÀȽÄê¤ò¤·¤Æ¤¤¤ë¤Î¤À¤¬¡¢¸òº¹ÅÀ¤Çľ¿Ê¤ò¤·¤Æ¤â¹õ¤¤¤È¤³¤í¤Ø¹Ô¤­±¦Àû²ó¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£²¼¤Î³¨¤ÎÌð°õ¤Î¤è¤¦¤Ëưºî¤¹¤ëÃæ¤Ç¤Î±¦Àû²ó¤Î²ó¿ô¤ò¥«¥¦¥ó¥È¤¹¤ë¤Î¤À¤¬¡¢ÅÓÃæ¤Çľ¿Ê¤¬Æþ¤Ã¤Æ¤·¤Þ¤Ã¤Æ¤â¹õ¤¤¤È¤³¤í¤Ç¤Þ¤¿±¦Àû²ó¤ò¤·¤Æ¥«¥¦¥ó¥È¤¬Â³¤±¤é¤ì¤ë¡£Ä¾¿Ê¤Çn¤ò¥ê¥»¥Ã¥È¤·¤Æ¤·¤Þ¤¦¤È¡¢¤½¤ì¤Þ¤Ç¤Î±¦Àû²ó¤Î¥«¥¦¥ó¥È¤¬¤Ê¤¯¤Ê¤ê¡¢¥×¥í¥°¥é¥à¤¬Â³¤­¸òº¹ÅÀȽÄ꤬½ÐÍè¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¤È¹Í¤¨¤¿¡£¤Þ¤¿¡¢Àþ¤Î¿§¤ÎÇ»¤µ¤¬¶Ñ°ì¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢¥»¥ó¥µ¡¼¤ÎÆÉ¤ß¼è¤ëÃͤ¬ÊѤï¤Ã¤Æ¤·¤Þ¤¦¤³¤È¤ò¹Í¤¨¤¿¡£¼ÂºÝ¤Ë¤³¤ì¤Çư¤«¤·¤Æ¤âÌäÂê¤Ê¤¯¤Ç¤­¤Æ¤¤¤¿¤Î¤Ç¤½¤Î¤è¤¦¤Ë¤·¤¿¡£¤½¤¦¤¤¤¦°Õ¿Þ¤Çn¤Ë¤Ä¤¤¤Æ²¿¤â¤Ê¤¤¤È¤³¤í¤¬¤¢¤ë¡£Ä̾ï»þ­¡°Ê³°¤Ë¤ª¤¤¤Æ¤âƱÍͤÎÍýͳ¤À¡£

&ref(2017b/Member/Taka/Mission2/¥í¥Ü¡¡»ñÎÁ£².png,240x320,¸òº¹ÅÀ);


¥¹¥¿¡¼¥È¤Î½àÈ÷¤Î¥×¥í¥°¥é¥à¡£

 sub Start_Set(long x,long y)  //D¤«¤é¥¹¥¿¡¼¥È¤ÎÀþ¤Þ¤Ç
 {
     while (SENSOR_1 > THRESHOLD -9) {
         go_forward(x,y);
         Wait(STEP);
     }
     PlayTone(523,50);
 
     go_right1(x,y);Wait(300);
     PlayTone(740,300);
 }

»æ¥³¥Ã¥×¤Ë´Ø¤¹¤ë¥×¥í¥°¥é¥à¡£

 sub Cup_Catch()  //»æ¥³¥Ã¥×¤ò¼è¤ë
 {
     OnFwd(OUT_C,20);Wait(1300);
     Off(OUT_C);
     PlayTone(880,100);
 }
 
 sub Cup_Release()  //»æ¥³¥Ã¥×¤òÎ¥¤¹
 {
     OnFwd(OUT_C,-20);Wait(1300);
     Off(OUT_C);
     PlayTone(880,100);
 }
 

¥á¥¤¥ó¤Î¥×¥í¥°¥é¥à¤Ç¤¢¤ë¡£¼¡¤Î¥×¥í¥°¥é¥ß¥ó¥°¤¬¥¹¥à¡¼¥º¤Ë¤¤¤¯¤è¤¦¤Ë¸òº¹ÅÀȽÄê¤Ê¤É¤ò¤·¤¿¸å¤Ëµ°Æ»½¤Àµ¤ò¤¤¤ì¤¿¡£
 task main()
 {
     SetSensorLight(S1);  //¥»¥ó¥µ¡¼¤ò¥»¥Ã¥È
 
     Start_Set(0,0);  //D¡Á¥¹¥¿¡¼¥È
 
     L_Straight1(0,0);  //¥¹¥¿¡¼¥È¡ÁC
 
     go_right1(0,0);Wait(300);  //CÃÏÅÀľ¿Ê
 
     L_Straight1(0,0);  //C¡ÁB
     go_left2(0,0);Wait(200);  //µ°Æ»½¤Àµ
 
     L_Straight1(0,0);  //B¡ÁP
     Off(OUT_AB);Wait(1000);  //°ì»þÄä»ß
     go_left1(0,0);Wait(350);  //µ°Æ»½¤Àµ
 
     L_Straight2(0,0);  //P¡ÁQ
 
     go_right1(0,0);Wait(300);  //QÃÏÅÀľ¿Ê
 
     L_Straight2(0,0);  //Q¡ÁR
     go_left1(0,0);Wait(200);  //µ°Æ»½¤Àµ
 
     L_Straight1(0,0);  //R¡ÁE
     go_left2(0,0);Wait(300); //µ°Æ»½¤Àµ
 
     L_Straight1(0,0);  //E¡ÁµÞ¥«¡¼¥Ö¤ÎÆþ¤ê
 
     L_Turn1(sA2,sB2);  //µÞ¥«¡¼¥Ö
 
     L_Straight3(0,0);  //ľÀþ
 
     L_Turn2(sA2,sB2);  //µÞ¥«¡¼¥Ö
 
     L_Straight1(0,0);  //µÞ¥«¡¼¥Ö¤Î½Ð¡ÁF
     go_left2(0,0);Wait(150);  //µ°Æ»½¤Àµ
 
     L_Straight1(0,0);  //F¡ÁS
     Off(OUT_AB);Wait(1000);  //°ì»þÄä»ß
 
     go_right1(0,0);Wait(300);  //SÃÏÅÀľ¿Ê
 
     L_Straight4(0,0);  S¡Á
     go_right2(0,0);Wait(900);Off(OUT_AB);  //»æ¥³¥Ã¥×¤ò¼è¤ëºî¶È³«»Ï
     Cup_Catch();
     go_left2(0,0);Wait(1100);Off(OUT_AB);  //´°Î»
 
     L_Straight2(0,0);  //¡ÁS
     Off(OUT_AB);Wait(1000);  //°ì»þÄä»ß
 
     go_right1(0,0);Wait(300);  //SÃÏÅÀľ¿Ê
 
     L_Straight1(0,0);  //S¡ÁQ
     Off(OUT_AB);Wait(1000);  //°ì»þÄä»ß
     go_left1(0,0);Wait(350);  //µ°Æ»½¤Àµ
 
     L_Straight2(0,0);  //Q¡ÁR
 
     go_right1(0,0);Wait(300);  //RÃÏÅÀľ¿Ê
 
     go_right2(0,0);Wait(1000);Off(OUT_AB);  //»æ¥³¥Ã¥×¤òÃÖ¤¯ºî¶È³«»Ï
     Cup_Release();
     go_left2(0,0);Wait(1000);Off(OUT_AB);  //´°Î»
 
     L_Straight2(0,0);  //R¡ÁP
 
     L_Straight1(0,0);  //P¡ÁB
     go_left2(0,0);Wait(150);  //µ°Æ»½¤Àµ
     Off(OUT_AB);Wait(1000);  //°ì»þÄä»ß
 
     L_Straight1(0,0);  //B¡Á¥´¡¼¥ë
     PlayTone(740,300);
 
     go_right1(0,0);Wait(200);
     go_forward(0,0);Wait(500);  //¥´¡¼¥ë¤«¤éA
 }

*¤Þ¤È¤á [#o055941e]

**È¿¾Ê [#s093df6f]
ËÜÈ֤ǤϽé¤á¤ÎPÃÏÅÀ¤Ç¤¦¤Þ¤¯¤¤¤«¤º¡¢¤½¤Î¸å¤Î£²¡¢£³¸Ä¤Î¥×¥í¥°¥é¥à¤Þ¤Çư¤¤¤Æ¤·¤Þ¤Ã¤¿¡£¤½¤Î¸å¡¢EÃÏÅÀ¤Î¤¢¤¿¤ê¤Þ¤Ç¶¯°ú¤Ë°Üư¤µ¤»¤¿¤¬¡¢¤½¤Î¸å¤Îưºî¤Ï¤¹¤Ù¤Æ¤¦¤Þ¤¯¤¤¤Ã¤¿¡£Îý½¬¤ÎÃʳ¬¤ÇP¤äQ¤Î¤È¤³¤í¤Ç¸òº¹ÅÀ¤òÈ¿±þ¤·¤Ê¤«¤Ã¤¿¤ê¡¢¼¡¤Î¥×¥í¥°¥é¥à¤Þ¤Ç²á¾ê¤ËÈ¿±þ¤·¤¿¤ê¤È¤¤¤¦¤³¤È¤¬¤¢¤ê¡¢½¤Àµ¤¹¤ë¤Î¤Ë¶ìÏ«¤·¤¿¡£¤Ç¤­¤ë¸Â¤ê¤Î²þÁ±¤Ï¤·¤¿¤¬¡¢¤¦¤Þ¤¯¤¤¤¯¤È¤­¤È¤¤¤«¤Ê¤¤¤È¤­¤¬¤¢¤ê¡¢ËÜÈÖ¤ÏÅÒ¤±¤Ê¤È¤³¤í¤¬¤¢¤Ã¤¿¡£»æ¥³¥Ã¥×¤ò¼è¤ëÉôʬ¤Ë´Ø¤·¤Æ¤Ï¡¢¹©Éפ·¤¿L»ú¤Î¥Ð¡¼¤¬¤¦¤Þ¤¤¤³¤È¤Ï¤Þ¤Ã¤Æ¥¹¥à¡¼¥º¤«¤Ä³Î¼Â¤Ë¼è¤ë¤³¤È¤¬½ÐÍ褿¡£

**´¶ÁÛ [#u75efa78]
½øÈפϥ³¡¼¥¹ºî¤ê¤Ç²þÁ±¤¹¤ë¤³¤È¤¬¤¢¤Ã¤¿¤ê¡¢¥×¥í¥°¥é¥à¤ò°ì¿·¤·¤¿¤ê¤ÈÂçÊѤÀ¤Ã¤¿¡£¤¿¤Àºî¶È¤ÏÁ´ÂÎŪ¤Ë³Ú¤·¤«¤Ã¤¿¡£²ÝÂ꣱¤ËÈæ¤Ù¤ÆÂçÊѤÊÉôʬ¤â¿¤«¤Ã¤¿¤¬¡¢¤½¤ÎʬãÀ®´¶¤âÂ礭¤¯¥×¥í¥°¥é¥à¤¬¤¦¤Þ¤¯¤¤¤Ã¤Æ¥í¥Ü¥Ã¥È¤¬¤Á¤ã¤ó¤Èư¤¤¤Æ¤¯¤ì¤¿¤È¤­¤Ï¤È¤Æ¤â¤¦¤ì¤·¤«¤Ã¤¿¡£ËÜÈ֤Ϥ¦¤Þ¤¯¤¤¤«¤Ê¤¤¤È¤³¤í¤â¤¢¤Ã¤¿¤¬¡¢¤¦¤Þ¤¯¤¤¤Ã¤¿Éôʬ¤â¿¤¯¤¢¤Ã¤¿¤Î¤ÇÂ礭¤ÊãÀ®´¶¤òÆÀ¤é¤ì¤¿¡£

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