[[2016a/Member]] *Ìܼ¡ [#qc6cf508] #contents *²ÝÂê [#k4944c16] ¡Ú²ÝÂê¤Î¥³¡¼¥¹¡Û #ref(./2016a-mission2.png,²ÝÂê¤Î¥³¡¼¥¹) º£²ó¤Î²ÝÂê¤Ï»ØÄꤵ¤ì¤¿¥³¡¼¥¹¤ò¥é¥¤¥ó¥È¥ì¡¼¥¹¤¹¤ë¥í¥Ü¥Ã¥È¤ò¤Ä¤¯¤ë¤³¤È¡£¤¿¤À¤·¡¢¸òº¹ÅÀ¤Ç¤Ï°ìÉÃÄä»ß¤·¡¢²»¤òÌĤ餹¡£ BÃÏÅÀ¤«¤éCÃÏÅÀ¤Ø BÃÏÅÀ ¢ª R±¦ÀÞ ¢ª Qľ¿Ê ¢ª Qľ¿Ê ¢ªP±¦ÀÞ ¢ª S±¦ÀÞ ¢ª CÃÏÅÀ *¥í¥Ü¥Ã¥È¤Î¹½Â¤ [#a2d6a64e] ¡Ú¥í¥Ü¥Ã¥È¤Î¦ÌÌ¡Û #ref(./image2 (1).JPG,¥í¥Ü¥Ã¥È¤Î¦ÌÌ) ¡Ú¥í¥Ü¥Ã¥È¤ÎÁ°ÌÌ¡Û #ref(./image3 (1).JPG,¥í¥Ü¥Ã¥È¤ÎÁ°ÌÌ) ¡Ú¥í¥Ü¥Ã¥È¤Î¸å¤í¡Û #ref(./image1 (1).JPG,¥í¥Ü¥Ã¥È¤Î¸å¤í) ¥í¥Ü¥Ã¥ÈËÜÂΤι½Â¤¤Ï²ÝÂ꣱¤ÈÂ礤¯ÊѤï¤é¤Ê¤¤¤¬¡¢¥í¥Ü¥Ã¥ÈÁ°Ì̤˸÷¥»¥ó¥µ¡ÊÀĤ¤»Í³Ñ¤¤¤â¤Î¡Ë¤ò¼è¤êÉÕ¤±¡¢¥é¥¤¥ó¥È¥ì¡¼¥¹¤¬¤Ç¤¤ë¤è¤¦¤Ë¤·¤¿¡£ *¥×¥í¥°¥é¥à [#e4975907] ¡Ú¥×¥í¥°¥é¥à¤ÎÄêµÁ¡Û #define turn_right1 OnRev(OUT_C);OnFwd(OUT_A); //±¦Àû²ó #define turn_left1 OnRev(OUT_A);OnFwd(OUT_C);¡¡ //º¸Àû²ó #define turn_right2 OnFwd(OUT_A);Off(OUT_C); //±¦ÀÞ #define turn_left2 OnFwd(OUT_C);Off(OUT_A); //º¸ÀÞ #define go OnFwd(OUT_AC);¡¡//Á°¿Ê #define TMAX TMAX¡Ê£ô¡Ë¡ÄϢ³¤·¤Æ¹õ¤Ë¤Ê¤Ã¤Æ¤â¥é¥¤¥ó¥È¥ì¡¼¥¹¤ò³¤±¤ë»þ´Ö¤ÎºÇÂçÃÍ¡££ô¤òÊѤ¨¤ë¤³¤È¤Ç»þ´Ö¤ò»ØÄê¤Ç¤¤ë¡£ Off¡ÄÄä»ß Wait¡Ê£ô¡Ë¡Ä£ôÉôַв᤹¤ë¤Þ¤Ç¡¢¼¡¤Î¥×¥í¥°¥é¥à¤Ë°Ü¹Ô¤·¤Ê¤¤ ¡ÚÆ»¤Î¤ê¤´¤È¤Î¼ê½ç¡Û ¡¥é¥¤¥ó¥È¥ì¡¼¥¹¡Ê¥Þ¥¸¥Ã¥¯¤Ç½ñ¤«¤ì¤¿¹õ¤¤¥³¡¼¥¹¤ÎÀþ¾å¤ò°Üư¤¹¤ë¤³¤È¡Ë task main() { int t; t = 0; ¸òº¹ÅÀ¤òÄ̤俲ó¿ô¤òÄ´¤Ù¤ë¤¿¤á¤ËÊÑ¿ô£ô¤ò»ÈÍѤ·¤¿ £ô¡á£ô¡Ü£±¤È¥×¥í¥°¥é¥à¤¹¤ë¤³¤È¤Ç¡¢¸òº¹ÅÀ¤òÄ̤뤿¤Ó¤Ë¥«¥¦¥ó¥È¤ò£±Áý¤ä¤¹¡Ê²¼¤ËµºÜ¡Ë SetSensor(SENSOR_2, SENSOR_LIGHT); while(t <= 7) { ClearTimer(0); while(FastTimer(0) < TMAX) { if(SENSOR_2 > 54){ turn_right1;ClearTimer(0); } else if (SENSOR_2 < 42){ turn_left1; } else if (SENSOR_2 > 50){ turn_right2;ClearTimer(0); } else if (SENSOR_2 < 44){ turn_left2;ClearTimer(0); } else { go;ClearTimer(0); } } while(t¡á¡û¡Ë¡Ä¡û¤Î´Ö¡¢¾ò·ï¤Ë½¾¤Ã¤Æ¥×¥í¥°¥é¥à¤ò·«¤êÊÖ¤¹¡£ ClearTimer¡Ä¥í¥Ü¥Ã¥È¤ËÆâ¢¤µ¤ì¤¿¥¿¥¤¥Þ¡¼¤ò¥ê¥»¥Ã¥È¤¹¤ë¡£ if¡Ä¥í¥Ü¥Ã¥È¤¬¼¡¤Ë²¿¤ò¤¹¤ë¤«¤òȽÃǤ¹¤ë¤¿¤á¤ËɬÍפʾò·ï¤ò»ØÄê¤Ç¤¤ë¡£ else if ¡Äif¤Ç»ØÄꤷ¤¿¾ò·ï°Ê³°¤Ç¡¢¤µ¤é¤Ë¾ò·ï¤òÄɲä·¤¿¤¤¾ì¹ç¤Ë»ÈÍѤ¹¤ë¡£ SENSOR2¡ä50¡Ä¸÷¥»¥ó¥µ¡¼£²¤ÎÃͤ¬50¤òͤ¨¤¿¾ì¹ç¡¢¾ò·ï¤Ë½¾¤Ã¤ÆÆ°ºî¤¹¤ë¡£ ¢£±¤ÄÌܤθòº¹ÅÀ¡ÊR¤ò±¦ÀÞ¡Ë t = t+1; if(t == 1){ PlaySound(SOUND_UP); Off(OUT_AC); Wait(100); turn_right2; Wait(150); Off(OUT_AC); Wait(100); PlaySound(SOUND_UP)¡Ä²»¤òÌĤ餹 PlaySound(SOUND_DOWN)¡Ä²»¤òÌĤ餹 ££²¤ÄÌܤθòº¹ÅÀ¡ÊQ¤òľ¿Ê¡Ë } else if(t == 2){ PlaySound(SOUND_UP); turn_left1; Wait(100); } else if(t == 3){ PlaySound(SOUND_UP); Off(OUT_AC); Wait(100); go; Wait(30); Off(OUT_AC); Wait(100); ¤£³¤ÄÌܤθòº¹ÅÀ¡ÊQ¤òľ¿Ê¡Ë } else if(t == 4){ PlaySound(SOUND_UP); Off(OUT_AC); Wait(100); go; Wait(30); Off(OUT_AC); Wait(100); ¥£´¤ÄÌܤθòº¹ÅÀ¡ÊP¤ò±¦ÀÞ¡Ë } else if(t == 5){ PlaySound(SOUND_UP); Off(OUT_AC); Wait(100); turn_right2; Wait(100); Off(OUT_AC); Wait(100); ¦£µ¤ÄÌܤθòº¹ÅÀ¡ÊS¤ò±¦ÀÞ¡Ë } else if(t == 6){ PlaySound(SOUND_UP); Off(OUT_AC); Wait(100); turn_right2; Wait(100); Off(OUT_AC); Wait(100); §ºÇ¸å } else if(t==7){ PlaySound(SOUND_DOWN); Off(OUT_AC); } Off(OUT_AC); } } *·ë²Ì [#u7f2ecfe] É´È¯É´Ãæ¤Ç¥´¡¼¥ë¤Ë¤¿¤É¤êÃ夯¤ï¤±¤Ç¤Ï¤Ê¤¤¤¬¡¢²ÝÂêÄ̤ê¤Ëư¤«¤¹¤³¤È¤¬¤Ç¤¤¿¡£ ¥´¡¼¥ë¤Ë¤¿¤É¤êÃ夯¤Þ¤Ç¤Î»þ´Ö¤Ï45ÉäÀ¤Ã¤¿¡£ *ÌäÂêÅÀ£± [#bc1bc87e] ¥µ¥Ö¥ë¡¼¥Á¥ó¡¢¤½¤Î¾¤Î¥×¥í¥°¥é¥ß¥ó¥°¤Î°ÕÌ£¤ä»È¤¤Êý¤ò¤è¤¯Íý²ò¤·¤Æ¤¤¤Ê¤¤¡£ ¡ÚÂкö¡Û ¥«¥¦¥ó¥¿¡¼¤òÍøÍѤ·¤¿¡£¤·¤«¤·¡¢¤Þ¤ÀÍý²ò¤·¤¤ì¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢¼¡¤Î²ÝÂê¤ò½ª¤¨¤ë¤Þ¤Ç¤Ë°ÕÌ£¤ò³Ð¤¨¤¿¤¤¡£ *ÌäÂêÅÀ£² [#tde6c549] ¥³¡¼¥¹¤ÎÌÀ¤ë¤µ¤¬¥Ð¥é¥Ð¥é¤Ê¤Î¤«¸÷¥»¥ó¥µ¡¼¤¬°ÂÄꤷ¤Ê¤¤»þ¤¬¤¢¤ë¡£ ¡ÚÂкö¡Û ¤È¤³¤í¤É¤³¤í¿§¤òÅɤꡢ¸÷¥»¥ó¥µ¡¼¤Î°ÌÃÖ¤òÊѤ¨¤ë¤³¤È¤ÇÂн褷¤¿¡£¤½¤ì¤Ç¤â¡¢´°Á´¤ËÂнè¤Ç¤¤¿¤ï¤±¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢·«¤êÊÖ¤·Ä´À°¤¹¤ë¤³¤È¤ÇÂбþ¤·¤¿¡£ *¸òº¹ÅÀ¤ÎȽÃÇ [#je0807bf] ¸òº¹ÅÀ¤Ï¼¡¤Î¼ê½ç¤ÇȽÊ̤·¤¿¡£ ¡TMAX¡Ê¾å¤ËµºÜ¡Ë¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¡¢¸÷¥»¥ó¥µ¡¼¤¬Ï¢Â³¤Ç¹õ¤Ë¤Ê¤Ã¤¿»þ´Ö¤ËÀ©¸Â¤òÉÕ¤±¤ë¤³¤È¤Ç¸òº¹ÅÀ¤«¤É¤¦¤«¤ò¶èÊ̤¹¤ë¡£ ¡TMAX¡Ê¾å¤ËµºÜ¡Ë¤ò»ÈÍѤ·¡¢¸÷¥»¥ó¥µ¡¼¤¬Ï¢Â³¤Ç¹õ¤Ë¤Ê¤Ã¤¿»þ´Ö¤ËÀ©¸Â¤òÉÕ¤±¤ë¤³¤È¤Ç¸òº¹ÅÀ¤«¤É¤¦¤«¤ò¶èÊ̤¹¤ë¡£ ¡Î£±¡Ï¹õ¤Ë¤Ê¤Ã¤¿»þ´Ö¤¬ºÇÂçÃÍ£²£°°Ê¾å¤Î»þ ¤½¤³¤Ï¸òº¹ÅÀ¤ÈȽÃǤ·¤Æ¡¢ÊÌ¤ÎÆ°ºî¤Ø¤ÈÀÚ¤êÂØ¤¨¤ë¡£ ¡Î£²¡Ï¹õ¤Ë¤Ê¤Ã¤¿»þ´Ö¤¬£²£°°Ê²¼¤Î»þ¤ËÇò¤ò·×¬¤·¤¿»þ ¢¸òº¹ÅÀ¤Ç¤Ï¤Ê¤«¤Ã¤¿¾ì¹ç ¥×¥í¥°¥é¥à¤Ë½¾¤Ã¤Æ¡¢¥é¥¤¥ó¥È¥ì¡¼¥¹¤ò³¤±¤Æ¹Ô¤¦¡£ £¸òº¹ÅÀ¤ÈȽÃǤ·¤¿¤¢¤È¤Îưºî¤ò»ØÄê ¥«¥¦¥ó¥¿¡¼¤òÍøÍѤ¹¤ë¤³¤È¤Ç¡¢¤½¤ì¤¾¤ì¤Î¸òº¹ÅÀ¤Ë¤¿¤É¤êÃ夤¤¿¤¢¤È¤Î¹Ôư¤ò»ØÄꤷ¤¿¡£ ¸òº¹ÅÀ¤òȽÃǤ·¤Æ¡¢¤½¤Î¾ì¤Ç±¦ÀÞ¤·¤è¤¦¤È¤¹¤ë¤È¡¢±¦ÀÞ¸å¤Ë¥é¥¤¥ó¤ò¸«¼º¤¤¡¢¥é¥¤¥ó¥È¥ì¡¼¥¹¤¬¤Ç¤¤Ê¤¤¤³¤È¤¬¤¢¤ë¤Î¤Ç¡¢È½ÃǸå¤Ë£±ÅÙ¸òº¹ÅÀ¤òÄ̤ê²á¤®¡¢¤½¤Î¸å¤ËÀû²ó¤¹¤ë¤³¤È¤Ç¡¢¸òº¹ÅÀ¤ò¶Ê¤¬¤ì¤ë¤è¤¦¤Ë¤·¤¿¡£ ¤È½ÃǸå¤Ï·×¬Ãͤò¥ê¥»¥Ã¥È¤·¡¢¼¡¤Î¸òº¹ÅÀ¤òõ¤¹ *´¶ÁÛµÚ¤ÓÈ¿¾Ê [#mf8abedd] º£²ó¤Î²ÝÂê¤Ï¥×¥í¥°¥é¥ß¥ó¥°¤ò½Å»ë¤·¤¿¤â¤Î¤Ç¤¢¤ê¡¢Ä´À°¤ä¥×¥í¥°¥é¥à¤¬Èó¾ï¤ËÆñ¤·¤¯´¶¤¸¤¿¡£ºÇ½é¤Ï¥µ¥Ö¥ë¡¼¥Á¥ó¤ò»ÈÍѤ·¤¿¥×¥í¥°¥é¥à¤ò¹Í¤¨¤Æ¤¤¤¿¤¬¡¢¥í¥Ü¥Ã¥È¤¬»×¤¦¤è¤¦¤Ëưºî¤»¤º¡¢¥«¥¦¥ó¥¿¡¼¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤·¤¿¡£ºÇ½ªÅª¤ËÌÜŪÃϤˤ¿¤É¤êÃ夯¤³¤È¤Ï¤Ç¤¤¿¤¬¡¢Àµ³Î¤µ¡¦¥¹¥Ô¡¼¥É¤ò¹Í¤¨¤ë¤È¤Þ¤À¤Þ¤À²þÎɤǤ¤¿¤À¤í¤¦¡£º£²ó¤Ï»þ´Ö¤ÎÅÔ¹ç¾å¡¢²þÎɤ¹¤ë¤³¤È¤Ï¤Ç¤¤Ê¤«¤Ã¤¿¤¬¡¢¼¡¤ÏÁ᤯²ÝÂê¤ò¥¯¥ê¥¢¤·¡¢¤è¤ê¤è¤¯¤Ç¤¤ë¤è¤¦¤Ë¤·¤¿¤¤¡£