アーム側プログラム

   #define SIGNALON 11   // モータ回転のためのメッセージ
    #define SIGNALOFF 12  // モータ停止のためのメッセージ
   task main ()
   {
     while (true) {
       if (SENSOR_2 <= 30){
       SendMessage(SIGNALON);
       Wait(500);
       OnFwd(OUT_C);
       Wait(100);
       OnRev(OUT_A);
       Wait(200);
       OnFwd(OUT_A);
       Wait(100);
       OnRev(OUT_C);
       Wait(20);
       Off(OUT_AC);
       }
     }
   }

タイヤ側プログラム


// 受信側のプログラム
//
   #define SIGNALON 11
   #define SIGNALOFF 12
   task main ()
   {
     ClearMessage(); // Message()の値を0に初期化
     while (true) {
       until (Message() == SIGNALON);
       Wait(600);
       OnFwd(OUT_AC);
       Wait(200);
       Off(OUT_AC);
     }
   }


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS