Code: #pragma config(Sensor, S1, sonarLight, sensorSONAR) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{ while(true) {
while(SensorValue[sonarLight] > 40)
{ motor[motorC] = 75; motor[motorB] = 75; } PlaySoundFile("DOG05.rso"); wait1Msec(500); motor[motorC] = -75; motor[motorB] = 75; wait1Msec(1000); motor[motorC] = 75; motor[motorB] = 75; wait1Msec(500);
}
}
|