imu rev1

Dependencies:   IMUfilter mbed

Fork of AIviate by UCLA IEEE

Revision:
2:452dd766d212
Parent:
0:0c627ff4c5ed
Child:
3:f9e18a9cd9af
--- a/steps.cpp	Wed Oct 30 22:51:33 2013 +0000
+++ b/steps.cpp	Fri Nov 01 00:48:06 2013 +0000
@@ -5,12 +5,29 @@
 // in the future, change get_sensor_data to append the sensor data to a rolling list 
 void get_sensor_data()
 {
-    struct accel s;
+    struct sensor s;
     if (read_accelerometer(&s) == 0)
     {
-        pc.printf("Error!");
+        pc.printf("Error in get_sensor_data while reading from accel!\r\n");
         return;
     }
-    pc.printf("Ax: %i Ay: %i Az: %i\n", s.ax, s.ay, s.az);
+    
+    pc.printf("Ax: %i Ay: %i Az: %i;\r\n", s.ax, s.ay, s.az);
     return;
+}
+
+void init_sensors()
+{
+    // create config struct
+    struct config c;
+    
+    // set configurations
+    c.frequency = 10000;
+    
+    // pass configuration struct to configuration routine
+    int ret = config_gy80(&c);
+    if (ret == 0)
+    {
+        pc.printf("Error configuring sensors\r\n");
+    }
 }
\ No newline at end of file