aboutsummaryrefslogtreecommitdiffstats
path: root/testhal
diff options
context:
space:
mode:
authorRocco Marco Guglielmi <roccomarco.guglielmi@live.com>2016-05-10 17:19:18 +0000
committerRocco Marco Guglielmi <roccomarco.guglielmi@live.com>2016-05-10 17:19:18 +0000
commitcb24fff73ca3c72f7a1992165eb383100082c0e2 (patch)
treeb1e180c39f87a42f872f075170000653e9027fd9 /testhal
parent63f127f792aff967b99767665c936484f5c29b74 (diff)
downloadChibiOS-cb24fff73ca3c72f7a1992165eb383100082c0e2.tar.gz
ChibiOS-cb24fff73ca3c72f7a1992165eb383100082c0e2.tar.bz2
ChibiOS-cb24fff73ca3c72f7a1992165eb383100082c0e2.zip
Simplified L3GD20 demos
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9460 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r--testhal/STM32/STM32F4xx/SPI-L3GD20/main.c15
-rw-r--r--testhal/STM32/STM32L4xx/SPI-L3GD20/main.c19
2 files changed, 3 insertions, 31 deletions
diff --git a/testhal/STM32/STM32F4xx/SPI-L3GD20/main.c b/testhal/STM32/STM32F4xx/SPI-L3GD20/main.c
index fecdab5d8..fb4edfb21 100644
--- a/testhal/STM32/STM32F4xx/SPI-L3GD20/main.c
+++ b/testhal/STM32/STM32F4xx/SPI-L3GD20/main.c
@@ -114,24 +114,11 @@ int main(void) {
l3gd20Start(&L3GD20D1, &l3gd20cfg);
while(!palReadLine(LINE_BUTTON)){
- palToggleLine(LINE_LED3);
- gyroscopeReadRaw(&L3GD20D1, rawdata);
- for(i = 0; i < L3GD20_NUMBER_OF_AXES; i++)
- chprintf(chp, "RAW-%c:%d\r\n", axesID[i], rawdata[i]);
-
- gyroscopeReadCooked(&L3GD20D1, cookeddata);
- for(i = 0; i < L3GD20_NUMBER_OF_AXES; i++)
- chprintf(chp, "COOKED-%c:%.3f\r\n", axesID[i], cookeddata[i]);
-
- gyroscopeGetTemp(&L3GD20D1, &temperature);
- chprintf(chp, "TEMP:%.1f C°\r\n", temperature);
-
- chprintf(chp, "Press BUTTON to continue...\r\n");
+ chprintf(chp, "Press BTN to calibrate gyroscope...\r\n");
chThdSleepMilliseconds(150);
#if CHPRINTF_USE_ANSI_CODE
chprintf(chp, "\033[2J\033[1;1H");
#endif
- }
palClearLine(LINE_LED3);
chprintf(chp, "Calibrating Gyroscope sampling bias...\r\n");
diff --git a/testhal/STM32/STM32L4xx/SPI-L3GD20/main.c b/testhal/STM32/STM32L4xx/SPI-L3GD20/main.c
index 94850da3b..288a15c81 100644
--- a/testhal/STM32/STM32L4xx/SPI-L3GD20/main.c
+++ b/testhal/STM32/STM32L4xx/SPI-L3GD20/main.c
@@ -103,30 +103,15 @@ int main(void) {
l3gd20Start(&L3GD20D1, &l3gd20cfg);
while(!palReadLine(LINE_JOY_CENTER)){
- palToggleLine(LINE_LED_RED);
- gyroscopeReadRaw(&L3GD20D1, rawdata);
- for(i = 0; i < L3GD20_NUMBER_OF_AXES; i++)
- chprintf(chp, "RAW-%c:%d\r\n", axesID[i], rawdata[i]);
-
- gyroscopeReadCooked(&L3GD20D1, cookeddata);
- for(i = 0; i < L3GD20_NUMBER_OF_AXES; i++)
- chprintf(chp, "COOKED-%c:%.3f\r\n", axesID[i], cookeddata[i]);
-
- gyroscopeGetTemp(&L3GD20D1, &temperature);
- chprintf(chp, "TEMP:%.1f C°\r\n", temperature);
-
- chprintf(chp, "Press JOY to continue...\r\n");
+ chprintf(chp, "Press JOY to calibrate gyroscope...\r\n");
chThdSleepMilliseconds(150);
#if CHPRINTF_USE_ANSI_CODE
chprintf(chp, "\033[2J\033[1;1H");
#endif
}
-
- palClearLine(LINE_LED_RED);
+
chprintf(chp, "Calibrating Gyroscope sampling bias...\r\n");
chprintf(chp, "Keep it in the rest position while red LED is on\r\n");
- chThdSleepMilliseconds(3000);
-
palSetLine(LINE_LED_RED);
chThdSleepMilliseconds(1000);