aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F4xx/SPI-LIS3DSH/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32/STM32F4xx/SPI-LIS3DSH/main.c')
-rw-r--r--testhal/STM32/STM32F4xx/SPI-LIS3DSH/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/testhal/STM32/STM32F4xx/SPI-LIS3DSH/main.c b/testhal/STM32/STM32F4xx/SPI-LIS3DSH/main.c
index 011a30cda..e67eda9b8 100644
--- a/testhal/STM32/STM32F4xx/SPI-LIS3DSH/main.c
+++ b/testhal/STM32/STM32F4xx/SPI-LIS3DSH/main.c
@@ -32,6 +32,7 @@ static LIS3DSHDriver LIS3DSHD1;
static int32_t rawdata[LIS3DSH_NUMBER_OF_AXES];
static float cookeddata[LIS3DSH_NUMBER_OF_AXES];
+static int8_t temperature;
static char axesID[LIS3DSH_NUMBER_OF_AXES] = {'X', 'Y', 'Z'};
static uint32_t i;
@@ -121,7 +122,10 @@ int main(void) {
accelerometerReadCooked(&LIS3DSHD1, cookeddata);
for(i = 0; i < LIS3DSH_NUMBER_OF_AXES; i++)
- chprintf(chp, "COOKED-%c:%.3f\r\n", axesID[i], cookeddata[i]);
+ chprintf(chp, "COOKED-%c:%.3f g\r\n", axesID[i], cookeddata[i]);
+
+ accelerometerGetTemp(&LIS3DSHD1, &temperature);
+ chprintf(chp, "TEMP:%d \r\n", temperature);
chThdSleepMilliseconds(150);
#if CHPRINTF_USE_ANSI_CODE