指定した条件を満たしているか、満たしていないかで命令を分岐させます。
if(cds>60){ motor(3,100,100); redon(1); beep1(); } else{ motor(3,-100,-100); blueon(1); beep2(); }