[[2014a/Member]]

 #define black 36
 #define speed 35
 #define A 38
 #define B 65
 
 task main()
 {
 SetSensorLight(S1);
 SetSensorLight(S4);
 SetSensorLowspeed(S3);
 
 int msg;
 
 until(BluetoothStatus(1) == NO_ERR);
 RemotePlayTone(1,440,1000);
 
 Off(OUT_BC);
 Wait(1200);
 
 OnFwdSync(OUT_BC,speed,0);
 until(SENSOR_1 < black);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(500);
 
 OnFwdSync(OUT_BC,speed,0);
 Wait(400);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(500);
 
 OnFwdSync(OUT_BC,speed,0);
 until(SENSOR_1 < black);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(500);
 
 OnFwdSync(OUT_BC,speed,0);
 Wait(500);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(500);
 
 OnFwd(OUT_B,speed);
 OnRev(OUT_C,speed);
 until(SENSOR_1 < black);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(700);
 
 OnFwd(OUT_B,speed);
 OnRev(OUT_C,speed);
 Wait(180);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(500);
 
 OnFwdSync(OUT_BC,speed,0);
 Wait(1100);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(500);
 
 OnFwdSync(OUT_BC,speed,0);
 until(SENSOR_1 < black);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(500);
 
 OnFwdSync(OUT_BC,speed,0);
 Wait(500);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(500);
 
 OnFwdSync(OUT_BC,speed,0);
 until(SENSOR_1 < black);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(500);
 
 OnFwdSync(OUT_BC,speed,0);
 Wait(600);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(500);
 
 OnFwd(OUT_B,speed);
 OnRev(OUT_C,speed);
 until(SENSOR_1 < black);
 PlaySound(SOUND_CLICK);
 
 Off(OUT_BC);Wait(500);

 Off(OUT_BC);Wait(500);

 OnRevSync(OUT_BC,speed,0);
 Wait(2000);

 OnFwdSync(OUT_BC,speed,0);
 until(SensorUS(S3) <= 12);

 Off(OUT_BC);
 Wait(100);
 
 RemoteStartProgram(1,"z_slave.rxe");
 
 while(msg != 11){
 ReceiveRemoteNumber(MAILBOX1,true,msg);
 }
 PlaySound(SOUND_CLICK);
  
 if(SENSOR_4 < A){
 OnFwdSync(OUT_BC,speed,0);
 until(SensorUS(S3) <= 18);
 Off(OUT_BC);
 Wait(100);
 RemoteStartProgram(1,"z_slave-2.rxe");
 
 while(msg != 12){
 ReceiveRemoteNumber(MAILBOX1,true,msg);
 }
 PlaySound(SOUND_CLICK);

 }else if(SENSOR_4 < B){
 OnFwdSync(OUT_BC,speed,0);
 Wait(2000);
 PlaySound(SOUND_CLICK);
 Off(OUT_BC);Wait(500);
 OnFwd(OUT_B,speed);
 OnRev(OUT_C,speed);
 until(SensorUS(S3) < 18);
 PlaySound(SOUND_CLICK);
 Off(OUT_BC);
 Wait(100);
 RemoteStartProgram(1,"z_slave-2.rxe");
 
 while(msg != 12){
 ReceiveRemoteNumber(MAILBOX1,true,msg);
 }
 PlaySound(SOUND_CLICK);
 
 }else{
 OnFwdSync(OUT_BC,speed,0);
 Wait(6000);
 OnFwd(OUT_B,speed);
 OnRev(OUT_C,speed);
 until(SensorUS(S3) < 30);
 PlaySound(SOUND_CLICK);
 Off(OUT_BC);
 Wait(100);
 OnFwdSync(OUT_BC,speed,0);
 until(SensorUS(S3) <= 18);
 Off(OUT_BC);
 Wait(100);
 RemoteStartProgram(1,"z_slave-2.rxe");
 Off(OUT_BC);
 Wait(100);
 RemoteStartProgram(1,"z_slave-2.rxe");
 while(msg != 12){
 ReceiveRemoteNumber(MAILBOX1,true,msg);
 }
 PlaySound(SOUND_CLICK);
 
 }
 }



 task main()
 {
 PlaySound(SOUND_CLICK);
 OnFwd(OUT_A,70);Wait(2800);Off(OUT_A);
 OnRev(OUT_C,20);Wait(800);Off(OUT_C);
 OnRev(OUT_A,60);Wait(2800);Off(OUT_A);
 SendResponseNumber(MAILBOX1,11);
 Wait(1000);
 PlaySound(SOUND_CLICK);
 }



 task main()
 {
 PlaySound(SOUND_CLICK);
 OnFwd(OUT_A,60);Wait(900);Off(OUT_A);
 OnFwd(OUT_C,20);Wait(700);Off(OUT_C);
 OnRev(OUT_A,80);Wait(1800);Off(OUT_A);
 SendResponseNumber(MAILBOX1,12);
 Wait(1000);
 PlaySound(SOUND_CLICK);
 }

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