-
Notifications
You must be signed in to change notification settings - Fork 4
/
arduino.txt
71 lines (48 loc) · 1.53 KB
/
arduino.txt
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
random data containing arduino Code
//float heading = atan2(my, mx);
//if(heading < 0)
//heading += 2*PI;
// Check for wrap due to addition of declination.
//if(heading > 2*PI)
//heading -= 2*PI;
// Convert radians to degrees for readability.
//float headingDegrees = heading * 180/M_PI;
//Serial.print("Heading (degrees): "); Serial.println(headingDegrees);
/*if (mx < minX) minX = mx;
if (mx > maxX) maxX = mx;
if (my < minY) minY = my;
if (my > maxY) maxY = my;
if (mz < minZ) minZ = mz;
if (mz > maxZ) maxZ = mz;
// Calculate offsets
offX = (maxX + minX)/2;
offY = (maxY + minY)/2;
offZ = (maxZ + minZ)/2;
Serial.print("MINX : ");
Serial.print(minX);
Serial.println();
Serial.print("MAXX : ");
Serial.print(maxX);
Serial.println();
Serial.print("MINY : ");
Serial.print(minY);
Serial.println();
Serial.print("MAXY : ");
Serial.print(maxY);
Serial.println();
Serial.print("OFFX : ");
Serial.print(offX);
Serial.println();
Serial.print("OFFY : ");
Serial.print(offY);
Serial.println();
Serial.print("\n");
Serial.print("MINZ : ");
Serial.print(minZ);
Serial.println();
Serial.print("MAXZ : ");
Serial.print(maxZ);
Serial.println();
Serial.print("OFFZ : ");
Serial.print(offZ);
*/