Read board sensors (temperature, humidity, pressure, gyroscope, accelerometer, magnetometer) using ST BSP drivers. This example is superceded with the HelloWorld_ST_Sensors example.
Dependencies: BSP_B-L475E-IOT01
Information
This example is superceded with the HelloWorld_ST_Sensors example.
Import programHelloWorld_ST_Sensors
Simple application to test ST motion and environmental MEMS sensors. Supports NUCLEO+X-NUCLEO-IKS01A2 , STEVAL-STLKT01V1 (a.k.a. SensorTile) and B-L475E-IOT01A boards.
Diff: main.cpp
- Revision:
- 11:986c1f5db128
- Parent:
- 10:0964ad447861
- Child:
- 12:688020afdae7
--- a/main.cpp Thu Jul 06 09:58:14 2017 +0000 +++ b/main.cpp Fri Jul 07 07:08:37 2017 +0000 @@ -8,7 +8,7 @@ #include "stm32l475e_iot01_gyro.h" #include "stm32l475e_iot01_accelero.h" -DigitalOut led1(LED1); +DigitalOut led(LED1); int main() { @@ -26,7 +26,7 @@ while(1) { - led1 = 1; + led = 1; sensor_value = BSP_TSENSOR_ReadTemp(); printf("\nTEMPERATURE = %.2f degC\n", sensor_value); @@ -37,11 +37,11 @@ sensor_value = BSP_PSENSOR_ReadPressure(); printf("PRESSURE is = %.2f mBar\n", sensor_value); - led1 = 0; + led = 0; wait(1); - led1 = 1; + led = 1; BSP_MAGNETO_GetXYZ(pDataXYZ); printf("\nMAGNETO_X = %d\n", pDataXYZ[0]); @@ -58,7 +58,7 @@ printf("ACCELERO_Y = %d\n", pDataXYZ[1]); printf("ACCELERO_Z = %d\n", pDataXYZ[2]); - led1 = 0; + led = 0; wait(1);