-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyseRoom.c
31 lines (28 loc) · 1.25 KB
/
analyseRoom.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma config(Sensor, S1, Touch, sensorEV3_Touch)//sets up touch
#pragma config(Motor, motorB, motorLeft, tmotorEV3_Large, PIDControl, encoder)//sets up the left wheel
#pragma config(Motor, motorA, motorArm, tmotorEV3_Large, PIDControl, encoder)//sets up robot arm
#pragma config(Motor, motorC, motorRight, tmotorEV3_Large, PIDControl, encoder)//sets up the right wheel
#pragma config(Sensor, S2, Gyro, sensorEV3_Gyro)//sets up the gyro
#pragma config(sensor, S3, Color, sensorEV3_Color, modeEV3Color_Color)//sets up the light sensor to pickup colour
#pragma config(Sensor, S4, Sonar, sensorEV3_IRSensor, modeEV3IR_Proximity)//sets up the sonar to sense depth
void analyzeRoom()
{
drawBmpfile(0, 127, "Talking");
setMotorSpeed(motorLeft, -10);
setMotorSpeed(motorRight, -10);
wait1Msec(500);
resetGyro(Gyro);
wait1Msec(1000);
//Speaker.Play(100, "ev3_sounds/Analyze");
setSoundVolume(100);
playSoundFile("Robotics/ev3_sounds/ev3_Sounds/Sounds/Files/Informaton/Analyze");
//wait1Msec(1000);
repeatUntil(getGyroDegrees(Gyro) == -75)
{
setMotorSpeed(motorLeft, -20);
setMotorSpeed(motorRight, 20);
}
setMotorSpeed(motorLeft, 50);
setMotorSpeed(motorRight, 50);
wait1Msec(1000);
}