[[2016b/Member]]&br;
Ìܼ¡&br;
#contents
*²ÝÂê¤Ë¤Ä¤¤¤Æ [#o71d3bfc]
&ref(2016b/Member/pen/Mission3/2016b-mission3.png,50%,¥Þ¥Ã¥×);&br;
[[¾Ü¤·¤¯¤Ï¤³¤Á¤é:http://yakushi.shinshu-u.ac.jp/robotics/?2016b%2FMission3]]

&br;

*µ¡ÂΤˤĤ¤¤Æ [#ia2fc844]
º£²ó¤ï¤¿¤·¤¬Ã´Åö¤·¤¿¤Î¤Ï¡¢¥Ô¥Ã¥Á¥ã¡¼¤Î¥í¥Ü¥Ã¥È¤Ç¤¹¡£¥Ü¡¼¥ë¤Î¼Í½ÐÊýË¡¤È¤·¤Æ¡¢
+¥Ô¥Ã¥Á¥ã¡¼¥Þ¥·¥ó¤Î¤è¤¦¤ÊÂǤÁ½Ð¤·
+¼«Í³Íî²¼¤Ë¤è¤Ã¤ÆÅ¾¤¬¤¹&br;
¤Î2¼ïÎà¤ò¹Í¤¨¤Þ¤·¤¿¤¬¡¢1¤Ç¤Ï¡¢¥Ü¡¼¥ë¤Îȯ¼Í¤ÈÁõŶ¤ò1¤Ä¤Î¥â¡¼¥¿¡¼¤Ç¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ÅÀ¡¢2¤Ç¤Ï¡¢¤¢¤Þ¤ê®ÅÙ¤¬½Ð¤Ê¤¤¤¿¤á¡ÊÀª¤¤¤¬¤Ê¤¤¤Î¤Ç¡Ë¡¢»æ¤Î¾å¤Çµ°Æ»¤¬ÊѤï¤Ã¤Æ¤·¤Þ¤¦ÅÀ¡¢¤È¸À¤Ã¤¿ÌäÂ꤬¤¢¤ê¤Þ¤·¤¿¤¬¡¢1¤Ïµ»½ÑŪ¤Ë²ò·è²Äǽ¤ÊÅÀ¤Ç¤¢¤ë¤¿¤á¡¢1¤Î¹½Â¤¤Ë¤è¤Ã¤ÆÂǤÁ½Ð¤¹¤³¤È¤Ë¤·¤Þ¤·¤¿¡£
*¥Ð¥Ã¥¿¡¼¥í¥Ü¥Ã¥È¤Ë´Ø¤·¤Æ [#jc08c67b]
¥Ð¥Ã¥¿¡¼¥í¥Ü¥Ã¥È¤Ï¡¢È¯¼Í¤·¤¿¥Ü¡¼¥ë¤òÄϤߡ¢¥´¡¼¥ë¤ËÆþ¤ì¤ë¤È¤¤¤¦¤³¤È¤ò¹Ô¤¤¤Þ¤¹¡£¤³¤ÎºÝ¤ÎÏ¢·È¤Ë¤ª¤¤¤Æ¤Ï¡¢Bluetooth¤Î¥á¥Ã¥»¡¼¥¸(1~3¤Î¤É¤ì¤«¡Ë¤òÁ÷¤ê¡¢¥Ô¥Ã¥Á¥ã¡¼¤¬½èÍý¤ò¹Ô¤¤¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢Á´ÂΤÎή¤ì¤Ë´Ø¤·¤Æ¤Ï¡¢¥Ð¥Ã¥¿¡¼¥í¥Ü¥Ã¥È¤¬¤¹¤Ù¤Æ´ÉÍý¤ò¤·¤Æ¤¤¤Þ¤¹¡£
**µ¡ÂΤÎÁ´ÂÎÁü [#y6e3d023]
&ref(2016b/Member/pen/Mission3/Á´ÂÎÁü.jpeg,50%,Á´ÂÎÁü);
&ref(2016b/Member/pen/Mission3/Á´ÂÎÁü2.jpeg,50%,Á´ÂÎÁü);
&ref(2016b/Member/pen/Mission3/Á´ÂÎÁü_3.jpeg,50%,Á´ÂÎÁü);
&ref(2016b/Member/pen/Mission3/Á´ÂÎÁü_4.jpeg,50%,Á´ÂÎÁü);

&br;
***ȯ¼Íµ¡¹½ [#le9444f0]
&ref(2016b/Member/pen/Mission3/ȯ¼Í¥æ¥Ë¥Ã¥È.jpeg,50%);
&ref(2016b/Member/pen/Mission3/ȯ¼Í¥æ¥Ë¥Ã¥È_2.jpeg,50%);
&ref(2016b/Member/pen/Mission3/ÁõŶ¹½Â¤.jpeg,50%);
&ref(2016b/Member/pen/Mission3/¥®¥¢¥æ¥Ë¥Ã¥È.jpeg,50%);
&br;

***³Æ¼ï¥»¥ó¥µ¡¼ [#x20b2d67]
&ref(2016b/Member/pen/Mission3/¥»¥ó¥µ¡¼.jpeg,50%);
&ref(2016b/Member/pen/Mission3/¥»¥ó¥µ¡¼_2.jpeg,50%);
&br;

*¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ [#m5dc9ef0]
**¥×¥í¥°¥é¥à¤Î²òÀâ [#r8449133]
***¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î½èÍý [#sdfd9232]
[[Á°²ó¤ÈƱ¤¸:http://yakushi.shinshu-u.ac.jp/robotics/?2016b%2FMember%2Fpen%2FMission2#g8518f00]]

***¸òº¹ÅÀ¤Î½èÍý [#id38ca84]
[[Á°²ó¤ÎȽÄê½èÍý¤Ï¤½¤Î¤Þ¤Þ»È¤¤:http://yakushi.shinshu-u.ac.jp/robotics/?2016b%2FMember%2Fpen%2FMission2#xe8b6c3f]]ȽÄê¤Ë»È¤¦¥Ñ¥é¥á¡¼¥¿¡¼¤òÄ´Àᤷ¡¢¸òº¹ÅÀÆÍÆþ¸å100ms¤ÇȽÄ꤬²Äǽ¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
 line_trace_and_intersection_judgment(31,100);
¤³¤Î´Ø¿ô¤Ç¤Ï¡¢¥»¥ó¥µ¡¼¤ÎÃͤ¬31°Ê²¼¤Ç¤¢¤ê¡¢¤½¤ì¤¬100ms³¤¤¤¿¾ì¹ç¡¢¸òº¹ÅÀ¤ÈȽÊ̤·¤Þ¤¹¡£
***¶á¤¤ÊªÂΤ˸þ¤­¤ò¹ç¤ï¤»¤ë½èÍý [#he1de990]
¥¢¥ë¥ß´Ì¤ò¸¡½Ð¤¹¤ë¥×¥í¥°¥é¥à¤ò»²¹Í¤Ë¤·¤Þ¤·¤¿¡£¥»¥ó¥µ¡¼¤ÎÃͤ¬¤º¤ì¤¹¤®¤Ê¤¤¤è¤¦¤Ë¡¢Ê¿¶ÑÃͤò¼è¤ë¤è¤¦¤Ë¤¤¤¸¤ê¤Þ¤·¤¿¡£


**¥×¥í¥°¥é¥à¤Îή¤ì [#jd9c49fa]
¥Ý¥Ã¥Á¥ã¡¼¥í¥Ü¥Ã¥È¤Ç¤Ï¡¢¥Ð¥Ã¥¿¡¼¤«¤é£±¡Á£³¤ÎÈÖ¹æ¤ò¼õ¤±¼è¤ê¡¢¼õ¤±¼è¤Ã¤¿ÈÖ¹æ¤Ë±þ¤¸¤Æ¡¢¹Ôư¤ò¤·¤Þ¤¹¡£º£²ó¤Ç¤Ï¡¢1¤Ï¡¢¥¹¥¿¡¼¥ÈÃÏÅÀ¤«¤éȯ¼Í°ÌÃÖ¤Þ¤Ç¤Î°ÜÆ°¡£2¤Ï¡¢°ìÈֶᤤʪÂΤؤθþ¤­¹ç¤ï¤»¡¢3¤Ï¡¢¥Ü¡¼¥ë¤òȯ¼Í¤·¤Þ¤¹¡£¥Ü¡¼¥ë¤Îȯ¼Í¤Î¥¿¥¤¥ß¥ó¥°¹ç¤ï¤»¤Ç¤¹¤¬¡¢¥Ð¥Ã¥¿¡¼¤¬Ì¿Îá¤òÁ÷¿®¤·¤Æ¤«¤é¡¢Wait()ʬÂԤĤ³¤È¤Ç¡¢ÂǤÁ¤Þ¤¹¡£

***1ÈÖ¤Îή¤ì [#dd11ddcd]
&ref(2016b/Member/pen/Mission3/2016b-mission3-°Üư.png,120%);
&br;
­¡.5cmÁ°¿Ê&br;
­¢.1.2Éô֥饤¥ó¥È¥ì¡¼¥¹&br;
­£.±¦¤Ë70¡ë²óž&br;
­¤.30cmÁ°¿Ê&br;
­¥.6Éô֥饤¥ó¥È¥ì¡¼¥¹&br;
­¦.¸òº¹ÅÀ¤ò¸¡½Ð¤¹¤ë¤Þ¤Ç¥é¥¤¥ó¥È¥ì¡¼¥¹&br;
­§.7.2Éô֥饤¥ó¥È¥ì¡¼¥¹&br;
­¨.±¦¤Ë90¡ë²óž&br;
­©.13cmÁ°¿Ê&br;

***2ÈÖ¤Îή¤ì [#db08aef8]
¥Ð¥Ã¥¿¡¼¤ËÂФ·¤Æ¸þ¤­¤ò¹ç¤ï¤»¤Þ¤¹¡£¤½¤Î¤¿¤á¤Ë¡¢¥´¡¼¥ë¤ËÂФ·¤Æ¸þ¤­¤¬¹ç¤ï¤Ê¤¤¤è¤¦¤Ë¡¢Ãµ¤¹³ÑÅÙ¤òÄ´À°¤·¤Æ¤¤¤Þ¤¹¡£

***3ÈÖ¤Îή¤ì [#f8139746]
¥Ü¡¼¥ë¤òȯ¼Í¤·¤Þ¤¹¡£

**ËÜʸ [#y7358e18]
 #define moter_conect_move OUT_AB             //¶îÆ°ÎØ¥â¡¼¥¿¡¼¤ÎÀܳ¥³¥Í¥¯¥¿¡ÊABC½ç¡Ë
 #define moter_conect_option OUT_C            //¶îÆ°ÎØ°Ê³°¤Î¥â¡¼¥¿¡¼¤ÎÀܳ¥³¥Í¥¯¥¿¡ÊABC½ç¡Ë
 #define moter_conect_move_L OUT_A            //º¸¶îÆ°ÎØ¥â¡¼¥¿¡¼¤ÎÀܳ¥³¥Í¥¯¥¿
 #define moter_conect_move_R OUT_B            //±¦¶îÆ°ÎØ¥â¡¼¥¿¡¼¤ÎÀܳ¥³¥Í¥¯¥¿
 #define SPEED 55                             //Ä̾ï¥â¡¼¥¿¡¼Â®ÅÙ
 #define SPEED_FAST 60                        //Ä̾ï¥â¡¼¥¿¡¼Â®Å١ʹ⮡Ë
 #define SPEED_SLOW 40                        //Ä̾ï¥â¡¼¥¿¡¼Â®ÅÙ¡ÊÄ㮡Ë
 #define SPEED_line_trace 30                  //¥é¥¤¥ó¥È¥ì¡¼¥¹»þ¤Î®Å١ʵ¡ÂΤνÅÎ̤ˤè¤Ã¤ÆÄ´À᤹¤ë¡Ë
 #define SPEED_FAST_line_trace 40             //¥é¥¤¥ó¥È¥ì¡¼¥¹»þ¤Î®ÅÙ(¹â®)
 #define SPEED_SLOW_line_trace 30             //¥é¥¤¥ó¥È¥ì¡¼¥¹»þ¤Î®ÅÙ(Äã®)
 #define THRESHOLD 40                         //Çò¤È¹õ¤ÎÃæ´Ö¤ÎÈ¿¼ÍΨ

 
 
 const float diameter = 5.45;                 //¥¿¥¤¥ä¤Îľ·Â(cm)
 const float track = 11.38;                   //¥¿¥¤¥ä¤Î¥È¥ì¥Ã¥ÉÉý(cm)
 const float pi=3.1415;                       //±ß¼þΨ 
 
 

 //´Ø¿ô¥¨¥ê¥¢
 void stop_move()                             //¤¹¤Ù¤Æ¤Î½ÐÎϥ⡼¥¿¡¼¤ÎÄä»ß¡Ê¤¹¤Ù¤Æ¤Î¥µ¥Ö¥ë¡¼¥Á¥óÆâ¤ËƱ¤¸¤³¤È½ñ¤¯¤È¡¢¸«¤Å¤é¤¤¤¿¤á¡Ë
 {
    Off(OUT_ABC);
    Wait(1);
 }
  
 void fwdDist(float d)                        //µ÷Î¥ d cm Á°¿Ê
 {
    stop_move();                              //¥â¡¼¥¿¡¼¤Î¥ê¥»¥Ã¥È
    float angle = d/(pi*diameter)*360.0;			//Á°¿Ê¤ËɬÍפʳÑÅÙ¤ò·×»»¤¹¤ë
    RotateMotorEx(moter_conect_move, SPEED_SLOW, angle, 0, true, true);    //·×»»¤·¤¿³ÑÅÙÆ°¤«¤¹
 }
 
 void turnAng_L(float ang)                    //º¸¤Ë¡¡ang (¡ë)¡¡²óž¡¡
 {
    stop_move();                              //¥â¡¼¥¿¡¼¤Î¥ê¥»¥Ã¥È
    float angle = track/diameter * ang;       //º¸²óž¤ËɬÍפʳÑÅ٤η׻»
    RotateMotorEx(moter_conect_move, SPEED_SLOW, angle, 100, true, true);  //·×»»¤·¤¿³ÑÅÙÆ°¤«¤¹
 }
 
 void turnAng_R(float ang)                     //±¦¤Ë¡¡ang (¡ë)¡¡²óž¡¡
 {
    stop_move();                              //¥â¡¼¥¿¡¼¤Î¥ê¥»¥Ã¥È
    float angle = track/diameter * ang;       //±¦²óž¤ËɬÍפʳÑÅ٤η׻»
    RotateMotorEx(moter_conect_move, SPEED_SLOW, angle, -100, true, true); //·×»»¤·¤¿³ÑÅÙÆ°¤«¤¹
 }
 
 int searchDirection(long ang)                //°ìÈֶᤤµ÷Î¥¤òõ¤·¤Æ¡¢µ÷Î¥¡Êcm¡Ë¤òÊÖ¤¹(¥¢¥ë¥ß´Ì¤Î¸¡½Ð¥×¥í¥°¥é¥à¤ÈËØ¤ÉƱ¤¸)
 {
    stop_move();                              //¥â¡¼¥¿¡¼¤Î¥ê¥»¥Ã¥È
    long tacho_min ;
    int d_min = 300 ;
    
    long angle = (track/diameter)*ang;
    turnAng_L(ang/2);
    ResetTachoCount(moter_conect_move);
    
    OnFwdSync(moter_conect_move,SPEED_SLOW,-100);
    while(MotorTachoCount(moter_conect_move_L)<=angle)
    {
        int US_average = SensorUS(S4)       ; //3²ó¤Û¤ÉͲ»ÇÈ¥»¥ó¥µ¡¼¤ÎÃͤò¼èÆÀ¤·¡¢Ê¿¶ÑÃͤò½Ð¤¹¤³¤È¤Ç¡¢ÆÍȯŪ¤Ê¥»¥ó¥µ¡¼¤ÎÃͤΥº¥ì¤Î±Æ¶Á¤ò¾¯¤Ê¤¯¤¹¤ë
        US_average = US_average+SensorUS(S4); //
        US_average = US_average+SensorUS(S4); //
        US_average = US_average / 3 ;         //
        if (US_average<d_min)
        {
            d_min = SensorUS(S4);
            tacho_min = MotorTachoCount(moter_conect_move_L);
        }
    }
    OnFwdSyncEx(moter_conect_move,SPEED_SLOW,100,RESET_NONE);
    until(MotorTachoCount(moter_conect_move_L)<=tacho_min || SensorUS(S4)<=d_min);
    
    Wait(360);
    Off(moter_conect_move);Wait(500);
    return d_min;
     
 }
    
 void line_trace(int sensor_light_lv)          //¥é¥¤¥ó¥È¥ì¡¼¥¹¤Î¥×¥í¥»¥¹
 {
    if (sensor_light_lv < THRESHOLD-8)
    {
        OnFwd(moter_conect_move_R,SPEED_FAST_line_trace);
        OnFwd(moter_conect_move_L,-SPEED_FAST_line_trace);
    }
    else if (sensor_light_lv < THRESHOLD-5)
    {
        OnFwd(moter_conect_move_L,SPEED_SLOW_line_trace);
    }
    else if (sensor_light_lv < THRESHOLD +5)
    {
        OnFwdSync(moter_conect_move,SPEED_line_trace,0);
    }
    else if (sensor_light_lv < THRESHOLD+8)
    {
        OnFwd(moter_conect_move_R,SPEED_SLOW_line_trace);
    }
    else
    {
        OnFwd(moter_conect_move_L,SPEED_FAST_line_trace);
        OnFwd(moter_conect_move_R,-SPEED_FAST_line_trace);
    }
 }
 
 long intersection_judgment(long t0,int threshold)//Sensor¤ÎÃͤ¬Threshold(Ǥ°Õ¤ÎÈ¿¼ÍΨ)°Ê¾å¤Î¤È¤­¡¢°ú¿ô¤Ë¸½ºß¤Î»þ¹ï¤òÂåÆþ¤·ÊÖ¤¹¡£¤½¤ì°Ê³°¤ÏÊѹ¹¤»¤º°ú¿ô¤òÊÖ¤¹¡£
 {
    if (SENSOR_1 > threshold)                     //¸½ºß¤Î¥»¥ó¥µ¡¼¤ÎÃͤ¬¡¢Threshold°Ê¾å¤Î¤È¤­
    {
        t0 = CurrentTick();                       //¸½ºß¤ÎÃͤòt0¤ËÂåÆþ
    }
    return t0 ;                                   //t0¤ÎÃͤòÊÖ¤¹
 }
 

 

 //´Ø¿ô¡Êtask_main¤Ç¸Æ¤Ó½Ð¤¹¡Ë¥¨¥ê¥¢
 void set_sensor_all()
 {
    SetSensorLight(S1);                           // ¥é¥¤¥È¥»¥ó¥µ¡¼¤ÎÄêµÁ
    SetSensorLowspeed(S4);                        //Ͳ»ÇÈ¥»¥ó¥µ¡¼¤ÎÄêµÁ
 }
 
 void firing_ball()                               //¥Ü¡¼¥ë¤Îȯ¼Í´Ø¿ô
 {
    stop_move();                                  //¥â¡¼¥¿¡¼¤Î¥ê¥»¥Ã¥È¡Ê´Ø¿ô¤¬Ï¢Â³¤¹¤ëºÝ¡¢Off¤ò¶´¤Þ¤Ê¤¤¤È£µ¹ÔÌܰʹߤǥХ°¤¬µ¯¤­¤ë¡Ë
    RotateMotor(moter_conect_option,85,537);      //option¥â¡¼¥¿¡¼¡Ê¥Ü¡¼¥ëȯ¼ÍÁõÃ֡ˤΥ⡼¥¿¡¼¤Î²óž
 }
 
 void line_tracing_in_seconds(float seconds)      //seconds(ÉÃ)´Ö¡¢¥é¥¤¥ó¥È¥ì¡¼¥¹¤ò¤¹¤ë
 {
    stop_move();
    long t0 =CurrentTick();
    float temp=1000*seconds;                      //while¥ë¡¼¥×¤¬À®Î©¤¹¤ë´Ö¡¢1000*seconds¤òËè²ó·×»»¤¹¤ë¤Î¤¬¡¢±é»»Åª¤Ë̵Â̤Ǥ¢¤ë¤¿¤á¡¢temp¤ËÆþ¤ì¤ë
    while(CurrentTick()-t0 < temp)                //tempÉô֥롼¥×
    {
        line_trace(SENSOR_1);                     //¥é¥¤¥ó¥È¥ì¡¼¥¹¤ò¤¹¤ë
    }
 }
 
 void line_trace_and_intersection_judgment(int threshold,int judgment_time)     //¸òº¹ÅÀ¤òȽÃÇ(Threshold¤ÎÃͤÇȽÃÇ)¤¹¤ë¤Þ¤Ç¡¢¥é¥¤¥ó¥È¥ì¡¼¥¹¤ò¤¹¤ë
 {
    stop_move();                                  //¥â¡¼¥¿¡¼¥ê¥»¥Ã¥È
    long t0 = CurrentTick();                      //¸½ºß¤ÎÃͤòt0¤Ë¼èÆÀ
    while(CurrentTick()-t0 < judgment_time)       //judgment_time¤è¤êû¤¤»þ´Ö¤Î¹õ¤Î¸¡½Ð¤Ï̵»ë
    {
        line_trace(SENSOR_1);                     //¥é¥¤¥ó¥È¥ì¡¼¥¹¤ò¤¹¤ë
        t0=intersection_judgment(t0,threshold);   //¸½ºß¤¬threshold¤ÎÃͤè¤êÂ礭¤¤¤È¤­¡¢t0¤Ë¸½ºß¤ÎÃͤòÂåÆþ
    }
    stop_move();                                  //¥â¡¼¥¿¡¼¤ÎÄä»ß
    Wait(1000);                                   //¸òº¹ÅÀ¤Ç°ì»þÄä»ß
    PlaySound(SOUND_UP);                          //¸òº¹ÅÀ¸¡½Ð¤Ç²»¤òÌĤ餹
 }
 
 void move_A_to_inside_of_M()¡¡                   //¥¹¥¿¡¼¥ÈÃÏÅÀ¤«¤éȯ¼ÍÃÏÅÀ¤Þ¤Ç¤Î°Üư
 {
    fwdDist(5.0);                                 //5cmÁ°¿Ê
    line_tracing_in_seconds(1.2);                 //1.2Éô֥饤¥ó¥È¥ì¡¼¥¹
    turnAng_R(70.0);                              //±¦¤Ë70¡ëž
    fwdDist(30.0);                                //30cmÁ°¿Ê
    line_tracing_in_seconds(6.0);                 //6Éô֥饤¥ó¥È¥ì¡¼¥¹
    line_trace_and_intersection_judgment(31,100); //¸òº¹ÅÀ¤ò¸¡½Ð¤¹¤ë¤Þ¤Ç¥é¥¤¥ó¥È¥ì¡¼¥¹
    line_tracing_in_seconds(7.2);                 //7.2Éô֥饤¥ó¥È¥ì¡¼¥¹
    turnAng_R(90.0);                              //±¦¤Ë90¡ë²óž
    fwdDist(13.0);                                //13cmÁ°¿Ê
 }
 
  
 void mukiawase()                                 //¥í¥Ü¥Ã¥È¤Î¸þ¤­¤ò¹ç¤ï¤»¤ë
 {
    turnAng_L(10.0);                              //ÊÛÅö¤Î¥´¡¼¥ë¤ò¸¡½Ð¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë°Ù¤Î¿¶¤êÉý¤ÎÄ´Àá
    int a =searchDirection(60);                   //°ìÈֶᤤʪÂΤ˸þ¤­¤ò¹ç¤ï¤»¤ë
    turnAng_R(3.0);                               //¥Ð¥Ã¥¿¡¼¤ÎÂǤÁÊÖ¤¹µ¡¹½¤Ë¸þ¤­¤ò¹ç¤ï¤»¤ëÈùÄ´À°
 }
 
 void send_action_finish()                        //¥Ð¥Ã¥¿¡¼¤Ëưºî¤Î´°Î»¤òÁ÷¤ë
 {
    SendRemoteNumber(0,MAILBOX1,1);
 }
 
 int receive_action_signal()                      //¥Ð¥Ã¥¿¡¼¤«¤éÌ¿Îá¤ò¼õ¤±¼è¤ë
 {
    int temp = 0;                                 //¥á¥Ã¥»¡¼¥¸¤Î¼õ¼èÊÑ¿ô
    while(temp==0)                                //¥á¥Ã¥»¡¼¥¸¤¬½é´üÃͤ«¤éÊѤï¤ë¤Þ¤Ç¥ë¡¼¥×
    {
        ReceiveRemoteNumber(MAILBOX2,true,temp);  //¥á¥Ã¥»¡¼¥¸¤Î¼èÆÀ
    }
    PlaySound(SOUND_UP);                          //¥á¥Ã¥»¡¼¥¸¤ò¼õ¤±¼è¤Ã¤¿¤é²»¤òÌĤ餹
    return temp;                                  //¼õ¤±¼è¤Ã¤¿ÃͤòÊÖ¤¹
 }
 

 //task¥¨¥ê¥¢
 task main()
 {
    set_sensor_all();                             //¥»¥ó¥µ¡¼¤Î½é´ü²½
    int  action_number=0;                         //Ì¿Îᥳ¡¼¥É¤Îµ­²±ÊÑ¿ô
    while(true)
    {
        action_number  =  receive_action_signal();//Ì¿Îá¤Î¼õ¿®¤ò¤·¡¢ÊÑ¿ô¤ËÂåÆþ(¼õ¿®¤¹¤ë¤Þ¤Ç¤³¤Î¹Ô¤ÇÄä»ß)
        if (action_number == 1)                   //Ì¿Îᥳ¡¼¥É¤¬1¤Î¤È¤­
        {
            move_A_to_inside_of_M();              //¥Ô¥Ã¥Á¥ã¡¼¤Î°ÌÃÖ¤Þ¤Ç°ÜÆ°
            action_number = 0;                    //Ì¿Îᥳ¡¼¥É¤Î¥ê¥»¥Ã¥È
        }
        else if (action_number == 2)              //Ì¿Îᥳ¡¼¥É¤¬2¤Î¤È¤­
        {
             mukiawase();                         //¥í¥Ü¥Ã¥È¤Î¸þ¤­¤ò¹ç¤ï¤»¤ë
             action_number = 0;                   //Ì¿Îᥳ¡¼¥É¤Î¥ê¥»¥Ã¥È
        }
        else if (action_number == 3)              //Ì¿Îᥳ¡¼¥É¤¬3¤Î¤È¤­
        {
             firing_ball();                       //¥Ü¡¼¥ë¤Îȯ¼Í
             action_number = 0;                   //Ì¿Îᥳ¡¼¥É¤Î¥ê¥»¥Ã¥È
        }
        send_action_finish();                     //ưºî¤Î´°Î»¤òÄÌÃÎ
        PlaySound(SOUND_UP);                      //ưºî´°Î»¤Î²»
    }
 }


*´¶ÁÛ [#ued603b3]
º£²ó¡¢¥í¥Ü¥Ã¥ÈƱ»Î¤ÎÏ¢·È¤ò¥á¥¤¥ó¤Ë¹Ô¤Ê¤Ã¤¿¤¬¡¢¼ÂºÝ¤Ë¤ä¤Ã¤Æ¤ß¤Æ°ìÈÖ¶ìÏ«¤·¤¿¤Î¤¬¡¢Ä¶²»ÇÈ¥»¥ó¥µ¡¼¤¬¤¦¤Þ¤¯ÃͤòÊÖ¤·¤Æ¤¯¤ì¤Ê¤¤¤³¤È¤¬¤¢¤ë¤³¤È¤Ç¤¢¤Ã¤¿¡£¤½¤Î¤¿¤á¡¢º£²ó°ìÈÖ»þ´Ö¤ò»È¤Ã¤¿¤Î¤Ï¡¢¥í¥Ü¥Ã¥ÈƱ»Î¤Î¸þ¤­¤ò¹ç¤ï¤»¤ë¤Ê¤É¤Î¸þ¤­¹ç¤ï¤»¤Ç¤¢¤ê¡¢¥í¥Ü¥³¥óÅöÆü¤Ë¤Ê¤Ã¤Æ¤â¤¦¤Þ¤¯Ä´À᤬¤Ç¤­¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤¬¡¢º£²ó¤Î¥í¥Ü¥³¥ó¤ÎÈ¿¾ÊÅÀ¤Ç¤¢¤Ã¤¿¤È¤¤¤¨¤ë¡£¥í¥Ü¥Ã¥ÈƱ»Î¤Îµ÷Î¥¤Ï10cmÄøÅ٤ʤΤÀ¤¬¡¢¤½¤Îµ÷Î¥¤¬±ó¤¤¤è¤¦¤Ë¶¯¤¯´¶¤¸¤¿¡£º£²ó¤Ï¡¢Á°²ó»È¤Ã¤¿¥×¥í¥°¥é¥à¤òÀ°Íý¤·¡¢´Ø¿ô¤Ë¤¹¤ë¤³¤È¤Ç¡¢¥×¥í¥°¥é¥à¤ÎÀ߷פè¤ê¤â¡¢Ä´Àá¤ÎÊý¤Ë»þ´Ö¤ò¤µ¤¯¤³¤È¤¬½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤Î¤Ï²þÁ±¤µ¤ì¤¿ÅÀ¤Ç¤¢¤ë¤È»×¤¦¡£

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