Gerardo Carmona / Mbed 2 deprecated AVC_Robot_Controled_Navigation

Dependencies:   FXOS8700CQ SDFileSystem mbed

Fork of AVC_Robot_Controled_Navigation by AVR Competition

Revision:
1:ab09b233da7b
Parent:
0:3a322aad8c88
--- a/lib/magnometer.cpp	Thu Oct 16 01:59:21 2014 +0000
+++ b/lib/magnometer.cpp	Thu Oct 16 15:48:57 2014 +0000
@@ -1,6 +1,7 @@
 // ----- Libraries ------------------------------------------------------------------
 #include "mbed.h"
 #include "FXOS8700CQ.h"
+#include "magnometer.h"
 
 // ----- I/O Pins -------------------------------------------------------------------
 FXOS8700CQ fxos(PTE25, PTE24, FXOS8700CQ_SLAVE_ADDR1); // SDA, SCL, (addr << 1)
@@ -11,7 +12,8 @@
 
 // ----- Variables ------------------------------------------------------------------
 double mag_x, mag_y;
-double average;
+double avg_x, avg_y;
+//double average;
 
 // ----- Functions ------------------------------------------------------------------
 double get_mag_x(){
@@ -40,7 +42,7 @@
     avg_x = avg_x / 10;
     avg_y = avg_y / 10;
     
-    pc.printf("%d\n", avg_x);
+    //pc.printf("%d\n", avg_x);
     _angle = atan2((double)_x, (double)_y) * 180.0 / 3.14159;
     return _angle;
 }
\ No newline at end of file