From: Thomas Pietrzak Date: Mon, 21 Oct 2013 08:35:16 +0000 (+0000) Subject: i2c working. However, the app crash when accelerometer and gyroscope work together X-Git-Url: https://git.thomaspietrzak.com/?a=commitdiff_plain;h=f80c3934389e98e312d99ec0bdba65dae7f37cfc;p=multitouchglove.git i2c working. However, the app crash when accelerometer and gyroscope work together git-svn-id: svn+ssh://thomaspietrzak.com/var/svn/rep@126 47cf9a05-e0a8-4ed5-9e9b-101a649bc004 --- diff --git a/multitouchglove.c b/multitouchglove.c index fbf35d2..d398f62 100644 --- a/multitouchglove.c +++ b/multitouchglove.c @@ -15,7 +15,7 @@ #include #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