QC Control software

Dependencies:   mbed

Fork of dgps by Colin Stearns

Revision:
44:2ae602b89961
Parent:
10:c4745ddaaf6a
Child:
49:06721139d298
--- a/handle/handleCompass.cpp	Wed Apr 23 04:20:40 2014 +0000
+++ b/handle/handleCompass.cpp	Wed Apr 23 04:45:36 2014 +0000
@@ -1,16 +1,23 @@
 #include "handleCompass.h"
 
+compassHandle* compassHandle::hand = NULL;
+
 compassHandle::compassHandle(){
     heading = 0;
-    setup();
+    initialized = false;
 }
 
 void compassHandle::setup(){
+    initialized = true;
     compass.init();
     compass.enableDefault();
 }
 
 void compassHandle::run(){
+    if(!initialized){
+        setup();
+    }
     compass.read();
     heading = compass.get_heading();
+    USB::getSerial().printf("Compass heading: %f\r\n",heading);
 }
\ No newline at end of file