LCA 2008 Z-axis accelerometer demo
[fw/openalt] / sensors / sensors.c
index 86fb39c8b2c00375592dceb047f4aa89111046c0..1f69a3647d3d82d11bb3143d54e39ff0441e7dfb 100644 (file)
@@ -56,10 +56,14 @@ portTASK_FUNCTION (vSensorsTask, pvParameters __attribute__ ((unused)))
 
   xTickCount = xTaskGetTickCount ();
 
+  adcStartXYZ();
+
   for (;;)
   {
     vTaskDelayUntil (&xTickCount, 100 / portTICK_RATE_MS);
 
+    printf("tick\n");
+
     //
     //  Adjust the DAC value so we output a slow sine wave
     //
@@ -90,5 +94,12 @@ portTASK_FUNCTION (vSensorsTask, pvParameters __attribute__ ((unused)))
 
       xSemaphoreGive (semaphore);
     }
+
+    //
+    //  get and display last X, Y, and Z accelerometer readings,
+    //  the start another conversion
+    //
+    printf("%04x %04x %04x\n", adcReadX(), adcReadY(), adcReadZ());
+
   }
 }