-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdebug.ino
More file actions
103 lines (83 loc) · 1.85 KB
/
Copy pathdebug.ino
File metadata and controls
103 lines (83 loc) · 1.85 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
void debug()
{
Serial.begin(38400);
while (1)
{
//Serial.print((analogRead(FrontLeft_prox_pin) + analogRead(FrontLeft_prox_pin) + analogRead(FrontLeft_prox_pin) )/3);
//Serial.print((analogRead(mid_prox_pin) + analogRead(mid_prox_pin) + analogRead(mid_prox_pin) )/3);
//Serial.print(" ");
//Serial.println(analogRead(A8));
//Serial.println(sonar());
//readGyro();
//seeGyro();
flip();
//int puhi = 2;
//if ( ax - ax_thres >= 1100 )ledDisplay(puhi);
//else ledDisplay(puhi + 1);
//writeeprom();
int dis = sonar();
Serial.println(dis);
//debug_dis();
delay(100);
}
}
void debug_motor()
{
RUN(255, 255);
delay(1000);
RUN(255, -255);
delay(1000);
RUN(-255, 255);
delay(1000);
RUN(100, 100);
delay(1000);
RUN(0, 0);
delay(1000);
}
void debug_line()
{
Serial.print(analogRead(left_ir_pin));
Serial.print(" ");
Serial.print(analogRead(right_ir_pin));
Serial.println(" ");
}
void debug_dis()
{
Serial.print(analogRead(FrontLeft_prox_pin ));
Serial.print(" ");
Serial.print(analogRead(mid_prox_pin));
Serial.print(" ");
Serial.print(analogRead(FrontRight_prox_pin ));
Serial.print(" ");
Serial.print(analogRead(left_prox_pin));
Serial.print(" ");
Serial.print(analogRead(right_prox_pin));
Serial.println(" ");
}
void seeGyro()
{
#ifdef OUTPUT_READABLE_ACCELGYRO
// display tab-separated accel/gyro x/y/z values
Serial.print("a/g:\t");
//Serial.print(ax); Serial.print("\t");
//Serial.print(ay); Serial.print("\t");
//Serial.println(az); Serial.print("\t");
//Serial.print(gx); Serial.print("\t");
//Serial.print(gy); Serial.print("\t");
Serial.println(gz);//front
#endif
}
void writeeprom()
{
int a;
RUN(255,-255);
for ( a = 500; a < 1000 ; a++)
{
readGyro();
EEPROM.write(a, ax);
}
while(1)
{
RUN(0,0);
}
}