i2c working. However, the app crash when accelerometer and gyroscope work together
authorThomas Pietrzak <thomas.pietrzak@gmail.com>
Mon, 21 Oct 2013 08:35:16 +0000 (08:35 +0000)
committerThomas Pietrzak <thomas.pietrzak@gmail.com>
Mon, 21 Oct 2013 08:35:16 +0000 (08:35 +0000)
git-svn-id: svn+ssh://thomaspietrzak.com/var/svn/rep@126 47cf9a05-e0a8-4ed5-9e9b-101a649bc004

multitouchglove.c

index fbf35d2e7b4b970738875c89e17e73b01d34147b..d398f62f834904835895cc81d687b9d1d2e53f72 100644 (file)
@@ -15,7 +15,7 @@
 #include <LSM303DLHC.h>
 
 #define LEDS
-//#define GYRO
+#define GYRO
 #define ACCELERO
 
 #ifdef LEDS
@@ -83,7 +83,7 @@ void getGyroInfo()
     printf("Data update: %02x\n", gyroinfo.xDataUpdate);
     printf("Endianness: %02x\n", gyroinfo.xEndianness);
 }
-
+/*
 static void gyroTask(void *p) 
 {
     printf("Start gyro task\n");
@@ -97,7 +97,7 @@ static void gyroTask(void *p)
          vTaskDelay(1000);
     }
     free(values);
-}
+}*/
 #endif
 
 #ifdef ACCELERO
@@ -141,6 +141,8 @@ static void acceleroTask(void *p)
         return;
     while (1) 
     {
+         L3gxReadAngRate(values);
+         printf("Gyro: x=%.4f y=%.4f z=%.4f\n", values[0], values[1], values[2]);
          Lsm303dlhcAccReadAcc(values);
          printf("Accelero: x=%.4f y=%.4f z=%.4f\n", values[0], values[1], values[2]);
          vTaskDelay(1000);
@@ -168,8 +170,8 @@ int main()
     initGyro();
     printf("Get Gyro Information\n");
     getGyroInfo();
-    printf("Start gyroTask\n");
-    xTaskCreate(gyroTask, (const signed char *)NULL, configMINIMAL_STACK_SIZE, (void *)NULL, tskIDLE_PRIORITY, NULL);
+//    printf("Start gyroTask\n");
+//    xTaskCreate(gyroTask, (const signed char *)NULL, configMINIMAL_STACK_SIZE, (void *)NULL, tskIDLE_PRIORITY, NULL);
 #endif
 
 #ifdef ACCELERO