Ìܼ¡
#contents

*²ÝÂê­µ [#a246ac04]
 1.¥¹¥¿¡¼¥ÈÃÏÅÀ¤«¤é½Ðȯ¤·¡¢¹õ¤¤Àþ¤Ë¤½¤Ã¤ÆÆ°¤¯¡£
 2.°ì¤ÄÌܤν½»ú¤Î¸òº¹ÅÀ¤ÈÆó¤Ä¤á¤Î½½»ú¤Î¸òº¹ÅÀ¤Î´Ö¤ËÃÖ¤«¤ì¤¿¥Ô¥ó¥Ý¥ó¶Ì¤ò¤Ä¤«¤à¡£
 3.¤µ¤é¤Ë¹õÀþ¤Ë±è¤Ã¤ÆÆ°¤¤¤Æ¥´¡¼¥ëÃÏÅÀ¤òÌܻؤ¹¡£
 4.¥´¡¼¥ë¤Ë¸þ¤±¤Æ¥Ô¥ó¥Ý¥ó¶Ì¤ò¥·¥å¡¼¥È¤¹¤ë¡£
http://yakushi.shinshu-u.ac.jp/robotics/?plugin=ref&page=2014a%2FMission1&src=2014a-mission1.png



*¥í¥Ü¥Ã¥ÈËÜÂÎ [#n48599e1]
*¥í¥Ü¥Ã¥È¾Ò²ð [#n48599e1]
**¥í¥Ü¥Ã¥ÈÁ´ÂÎÁü [#n25c1197]
&ref(2014a/Member/kanzaki/Mission1/1.jpg,50%);&ref(2014a/Member/kanzaki/Mission1/2.jpg,50%);&ref(2014a/Member/kanzaki/Mission1/3.jpg,50%);

#ref
**¥É¥é¥¤¥Ö¥Ù¡¼¥¹ [#w67efe74]
²£¤«¤é¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Á°¤«¤é¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ä줫¤é
**¸÷¥»¥ó¥µ¡¼ [#n3a85bc1]
&ref(2014a/Member/kanzaki/Mission1/6.jpg,50%);

**¥×¥í¥°¥é¥à [#lf70b930]
*¸Î¤Ë¡¢À¤³¦¤Ï¡²¡²¤ËËþ¤Á¤Æ¤¤¤ë¡£ [#cc5ac1ee]
**¿À¤¬Æ³¤¤¤¿È×¾å¤ÎÀ¤³¦ [#wcfdadc8]
ÀÄ¿§¤ÎÉôÉʤ¬¸÷¥»¥ó¥µ¡¼¤Ç¤¹¡£¤³¤Î¥»¥ó¥µ¡¼¤Ë¤è¤Ã¤Æ¹õ¤«Çò¤«¤òȽÃǤ·¤Æ¥é¥¤¥ó¥È¥ì¡¼¥¹¤ò¤·¤Þ¤¹¡£
**¥Ô¥ó¥Ý¥ó¶Ì¤Î¥­¥ã¥Ã¥ÁÊýË¡ [#o0eff5eb]
&ref(2014a/Member/kanzaki/Mission1/7.jpg,50%);

¤³¤Î¼Ì¿¿¤Î¥¿¥¤¥ä¤ÎÉôÉʤò±¦²óž¤µ¤»¡¢¥Ô¥ó¥Ý¥ó¶Ì¤¬¥¿¥¤¥ä¤Ë¿¨¤ì¤¿¤éÆ⦤ËÆþ¤ê

¥¿¥¤¥ä¤ò²óž¤µ¤»Â³¤±¡¢¥Ô¥ó¥Ý¥ó¶Ì¤¬Î¥¤ì¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£
**¥Ô¥ó¥Ý¥ó¶Ì¤Î¥·¥å¡¼¥ÈÊýË¡ [#wc2b0dac]
&ref(2014a/Member/kanzaki/Mission1/7.jpg,50%);

¥¿¥¤¥ä¤ÎÉôÉʤòº¸²óž¤µ¤»¡¢¤½¤¦¤¹¤ë¤È¥¿¥¤¥ä¤ÈϢư¤·¤Æ¤¤¤ë

&ref(2014a/Member/kanzaki/Mission1/8.jpg,50%);&ref(2014a/Member/kanzaki/Mission1/5.jpg,25%);

¤³¤Î¥Ñ¡¼¥Ä¤¬²óž¤·¡¢¥Ô¥ó¥Ý¥ó¶Ì¤ò²¡¤·½Ð¤¹¤è¤¦¤Ë¤·¤¿¡£
*¥×¥í¥°¥é¥à [#lf70b930]

#define HIPOWER 4 ¡¡//ľÀþÍѤΥѥ
#define LOWPOWER 2¡¡//¥«¡¼¥ÖÍѤΥѥ
#define set_power_H SetPower(OUT_AC,HIPOWER);
#define set_power_L SetPower(OUT_AC,LOWPOWER);
#define go_forward set_power_H; OnFwd(OUT_AC);¡¡//ľ¿Ê
#define turn_left1 set_power_L;\
OnFwd(OUT_C); OnRev(OUT_A);¡¡¡¡//º¸Àû²ó
#define turn_left0 set_power_L;\
OnFwd(OUT_C); Off(OUT_A);¡¡¡¡//º¸ÀÞ
#define turn_right0 set_power_L;\
OnFwd(OUT_A); Off(OUT_C);¡¡¡¡//±¦Àû²ó
#define turn_right1 set_power_L;\
OnFwd(OUT_A); OnRev(OUT_C);¡¡//±¦ÀÞ
#define cross set_power_H; OnFwd(OUT_AC);Wait(20);¡¡//¸òº¹ÅÀ¤òÅϤë
 
task main()
{
  SetSensor(SENSOR_2,SENSOR_LIGHT); //¸÷¥»¥ó¥µ¡¼¥»¥Ã¥È
  int nl=0;¡¡¡¡//¸òº¹ÅÀ¤ò´¶ÃΤ¹¤ë¤¿¤á¤ÎÊÑ¿ô
  int cc=0;¡¡¡¡//¸òº¹ÅÀ¤òÅϤä¿¿ô
  int hc=0;
  go_forward;¡¡//¥¹¥¿¡¼¥È¤ÎÏȤ«¤é½Ð¤ë¤¿¤á¤Îľ¿Ê
  Wait(100);
  ClearTimer(0);¡¡//¥¿¥¤¥Þ¡¼0¤ò¥»¥Ã¥È
  OnRev(OUT_B);¡¡//¥Ô¥ó¥Ý¥ó¶Ì¤¬Î¥¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Î¥¿¥¤¥ä¤ò²ó¤¹

  while (true) {  
**¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥×¥í¥°¥é¥à [#ab6e2d4f]
  while ((nl < 5)||(FastTimer(0)<500)||(FastTimer(1)<680)){
    if (SENSOR_2 < 37) {
      turn_left1;
       nl++;
    } else if (SENSOR_2 < 39) {
      turn_left0;   
 nl=0;
    } else if (SENSOR_2 < 45) {
      go_forward;   
 nl=0;
    } else if (SENSOR_2 < 47) {
      turn_right0;  
    } else {
       turn_right1; 
 nl=0;
    }      
    Wait(1);
  }¡¡
**¸òº¹ÅÀ¤Î¥×¥í¥°¥é¥à [#sf572cb3]
  turn_right1; Wait(35);¡¡//¸òº¹ÅÀ¤ò´¶ÃΤ¹¤ë¤È¤­¤Ë¤º¤ì¤¿¤Î¤òÄ´À°
  cross;¡¡¡¡//¸òº¹ÅÀ¤òÅϤë
  nl=0;
  cc++;
  hc++;
**¥Ô¥ó¥Ý¥ó¶Ì¤ò¤Ä¤«¤à¥×¥í¥°¥é¥à [#m87d58d3]
 while(hc==1){
  turn_right1;  
  Wait(70);
  go_forward;¡¡//¥Ü¡¼¥ë¤ò¥­¥ã¥Ã¥Á
  Wait(80);
  turn_left0; ¡¡//¥Ü¡¼¥ë¤ò¸ÇÄê
  Wait(100);  
  hc++;
 }
**¸òº¹ÅÀ¤È´ª°ã¤¤¤·¤Ê¤¤¤¿¤á¤Î¥×¥í¥°¥é¥à [#mbbcc9c9]
 while((hc==3)||(hc==5)){
  ClearTimer(1);¡¡¡¡//2¸ÄÌܤÈ3¸ÄÌܤθòº¹ÅÀ¤òÅϤ俤饿¥¤¥Þ¡¼1¤ò¥»¥Ã¥È¤¹¤ë¡£
  hc++;
 }
**¥Ô¥ó¥Ý¥ó¶Ì¤ò¥·¥å¡¼¥È¤¹¤ë¥×¥í¥°¥é¥à [#k76e02b9]
 while (cc==4) {
  turn_right1; //³ÑÅÙ¤òÈùÄ´À°
  Wait(5);
  OnRev(OUT_AC);¡¡//¥´¡¼¥ë¤Î³°¤Ë½Ð¤ë
  Wait(100);
  Off(OUT_ABC);
  OnFwd(OUT_B);¡¡//¥Ô¥ó¥Ý¥ó¶Ì¤ò¥·¥å¡¼¥È
  Wait(150);
  cc++;
 }
**»ß¤Þ¤ë¥×¥í¥°¥é¥à [#p5a0a237]
 while(cc==5){
  Off(OUT_ABC);¡¡//»ß¤Þ¤ë
 }

}

}
*¹©Éפ·¤¿¤È¤³¤í [#m33d8f14]
**¥í¥Ü¥Ã¥ÈËÜÂÎ [#lc45f7b3]
&ref(2014a/Member/kanzaki/Mission1/9.jpg,50%);

Ä줫¤é¤ß¤Æº¸Â¦¤Î²«¿§¤¤¥Ñ¡¼¥Ä¤òû¤¯¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢

¥Ô¥ó¥Ý¥ó¶Ì¤ò¥­¥ã¥Ã¥Á¤·¤ä¤¹¤¯¤·¤¿¡£


¥È¥Ã¥×   ¿·µ¬ °ìÍ÷ ¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS