1 #include <pololu/orangutan.h>
2 #include "assert.h"
3
test_motors()4 void test_motors()
5 {
6 clear();
7 print("Motors");
8 lcd_goto_xy(0,1);
9 print("Press A");
10 wait_for_button(BUTTON_A);
11
12 clear();
13 print("L slow");
14 lcd_goto_xy(0,1);
15 print("Press B");
16
17 set_motors(60,0);
18 wait_for_button(BUTTON_B);
19
20 clear();
21 print("L fast");
22 lcd_goto_xy(0,1);
23 print("Press C");
24
25 set_motors(255,0);
26 wait_for_button(BUTTON_C);
27
28 clear();
29 print("L- slow");
30 lcd_goto_xy(0,1);
31 print("Press A");
32
33 set_motors(-60,0);
34 wait_for_button(BUTTON_A);
35
36 clear();
37 print("L- fast");
38 lcd_goto_xy(0,1);
39 print("Press B");
40
41 set_motors(-255,0);
42 wait_for_button(BUTTON_B);
43
44 /// right motor
45 clear();
46 print("R slow");
47 lcd_goto_xy(0,1);
48 print("Press C");
49
50 set_motors(0,60);
51 wait_for_button(BUTTON_C);
52
53 clear();
54 print("R fast");
55 lcd_goto_xy(0,1);
56 print("Press A");
57
58 set_motors(0,255);
59 wait_for_button(BUTTON_A);
60
61 clear();
62 print("R- slow");
63 lcd_goto_xy(0,1);
64 print("Press B");
65
66 set_motors(0,-60);
67 wait_for_button(BUTTON_B);
68
69 clear();
70 print("R- fast");
71 lcd_goto_xy(0,1);
72 print("Press C");
73
74 set_motors(0,-255);
75 wait_for_button(BUTTON_C);
76
77 set_motors(0,0);
78 }
79