-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.c
55 lines (37 loc) · 894 Bytes
/
test.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//const tSensors sonarSensor = (tSensors) S1;
task main(){
//while(1){
//going forward at full capacity
/*
motor[motorB] = 100;
motor[motorC] = 100;
wait1Msec(2000);
*/
//Turning on the spot with 1 second duration
motor[motorB] = -50;
motor[motorC] = -50;
wait1Msec(225);
/*
nxtDisplayTextLine(2, "%d", SensorValue(S1));
while(SensorValue(sonarSensor)> 1000){
*/
//writeDebugStream("Sonar value: %d \n", SensorValue(sonarSensor));
motor[motorB] = 0;
motor[motorC] = 0;
wait1Msec(1000);
//}
//}
//Turning on the spot with 2 second duration
/*
motor[motorB] = 50;
motor[motorC] = -50;
wait1Msec(2000);
motor[motorB] = 50;
motor[motorC] = -50;
wait1Msec(3000);
//turning using different values.
motor[motorB] = 25;
motor[motorC] = 80;
wait1Msec(2000);
*/
}