Revision 1413
uses left and right motor in motor test instead of motor1 and motor2
trunk/code/projects/test/test_motors.c | ||
---|---|---|
13 | 13 |
motors_off(); |
14 | 14 |
delay_ms(3000); |
15 | 15 |
orb_set_color(YELLOW); |
16 |
motor1_set(1, SLOW);
|
|
17 |
motor2_set(1, SLOW);
|
|
16 |
motor_l_set(1, SLOW);
|
|
17 |
motor_r_set(1, SLOW);
|
|
18 | 18 |
delay_ms(3000); |
19 | 19 |
orb_set_color(GREEN); |
20 |
motor1_set(1, GO);
|
|
21 |
motor2_set(1, GO);
|
|
20 |
motor_l_set(1, GO);
|
|
21 |
motor_r_set(1, GO);
|
|
22 | 22 |
delay_ms(3000); |
23 | 23 |
|
24 | 24 |
//backward |
... | ... | |
26 | 26 |
motors_off(); |
27 | 27 |
delay_ms(3000); |
28 | 28 |
orb_set_color(YELLOW); |
29 |
motor1_set(0, SLOW);
|
|
30 |
motor2_set(0, SLOW);
|
|
29 |
motor_l_set(0, SLOW);
|
|
30 |
motor_r_set(0, SLOW);
|
|
31 | 31 |
delay_ms(3000); |
32 | 32 |
orb_set_color(GREEN); |
33 |
motor1_set(0, GO);
|
|
34 |
motor2_set(0, GO);
|
|
33 |
motor_l_set(0, GO);
|
|
34 |
motor_r_set(0, GO);
|
|
35 | 35 |
delay_ms(3000); |
36 | 36 |
|
37 | 37 |
//spin |
... | ... | |
39 | 39 |
motors_off(); |
40 | 40 |
delay_ms(3000); |
41 | 41 |
orb_set_color(YELLOW); |
42 |
motor1_set(1, SLOW);
|
|
43 |
motor2_set(0, SLOW);
|
|
42 |
motor_l_set(1, SLOW);
|
|
43 |
motor_r_set(0, SLOW);
|
|
44 | 44 |
delay_ms(3000); |
45 | 45 |
orb_set_color(GREEN); |
46 |
motor1_set(1, GO);
|
|
47 |
motor2_set(0, GO);
|
|
46 |
motor_l_set(1, GO);
|
|
47 |
motor_r_set(0, GO);
|
|
48 | 48 |
delay_ms(3000); |
49 | 49 |
|
50 | 50 |
//spin other way |
... | ... | |
52 | 52 |
motors_off(); |
53 | 53 |
delay_ms(3000); |
54 | 54 |
orb_set_color(YELLOW); |
55 |
motor1_set(0, SLOW);
|
|
56 |
motor2_set(1, SLOW);
|
|
55 |
motor_l_set(0, SLOW);
|
|
56 |
motor_r_set(1, SLOW);
|
|
57 | 57 |
delay_ms(3000); |
58 | 58 |
orb_set_color(GREEN); |
59 |
motor1_set(0, GO);
|
|
60 |
motor2_set(1, GO);
|
|
59 |
motor_l_set(0, GO);
|
|
60 |
motor_r_set(1, GO);
|
|
61 | 61 |
delay_ms(3000); |
62 | 62 |
//while(1){;} |
63 | 63 |
|
Also available in: Unified diff