Simple "hello world" style program for X-NUCLEO-IKS01A1 MEMS Inertial & Environmental Sensor Nucleo Expansion Board

Dependencies:   X_NUCLEO_IKS01A1 mbed

Dependents:   ese_project_copy ese_project_share

X-NUCLEO-IKS01A1 MEMS Inertial & Environmental Sensor Nucleo Expansion Board Firmware Package

Introduction

This firmware package includes Components Device Drivers, Board Support Package and example applications for STMicroelectronics X-NUCLEO-IKS01A1 MEMS Inertial & Environmental Nucleo Expansion Board.

Example Application

First of all, the example application outputs information retrieved from the Expansion Board over UART. Launch a terminal application (e.g.: PuTTY on Windows, Minicom on Linux) and set the UART port to 9600 bps, 8 bit, No Parity, 1 stop bit.

This is just a simple "hello world" style program for the X-NUCLEO-IKS01A1 MEMS Inertial & Environmental Sensor Nucleo Expansion Board.

Files at this revision

API Documentation at this revision

Comitter:
wobetz
Date:
Fri Mar 24 10:14:11 2017 +0000
Parent:
9:49650e8f0bb2
Commit message:
Align to latest `ST_INTERFACES`

Changed in this revision

X_NUCLEO_IKS01A1.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/X_NUCLEO_IKS01A1.lib	Thu Nov 24 16:19:41 2016 +0000
+++ b/X_NUCLEO_IKS01A1.lib	Fri Mar 24 10:14:11 2017 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/ST/code/X_NUCLEO_IKS01A1/#bd74c33ecbbd
+http://developer.mbed.org/teams/ST/code/X_NUCLEO_IKS01A1/#d1c67d482bad
--- a/main.cpp	Thu Nov 24 16:19:41 2016 +0000
+++ b/main.cpp	Fri Mar 24 10:14:11 2017 +0000
@@ -96,13 +96,13 @@
   
   printf("\r\n--- Starting new run ---\r\n");
 
-  humidity_sensor->ReadID(&id);
+  humidity_sensor->read_id(&id);
   printf("HTS221  humidity & temperature    = 0x%X\r\n", id);
-  pressure_sensor->ReadID(&id);
+  pressure_sensor->read_id(&id);
   printf("LPS25H  pressure & temperature    = 0x%X\r\n", id);
-  magnetometer->ReadID(&id);
+  magnetometer->read_id(&id);
   printf("LIS3MDL magnetometer              = 0x%X\r\n", id);
-  gyroscope->ReadID(&id);
+  gyroscope->read_id(&id);
   printf("LSM6DS0 accelerometer & gyroscope = 0x%X\r\n", id);
   
   wait(3);
@@ -110,24 +110,24 @@
   while(1) {
     printf("\r\n");
 
-    temp_sensor1->GetTemperature(&value1);
-    humidity_sensor->GetHumidity(&value2);
+    temp_sensor1->get_temperature(&value1);
+    humidity_sensor->get_humidity(&value2);
     printf("HTS221: [temp] %7s°C,   [hum] %s%%\r\n", printDouble(buffer1, value1), printDouble(buffer2, value2));
     
-    temp_sensor2->GetFahrenheit(&value1);
-    pressure_sensor->GetPressure(&value2);
+    temp_sensor2->get_fahrenheit(&value1);
+    pressure_sensor->get_pressure(&value2);
     printf("LPS25H: [temp] %7s°F, [press] %smbar\r\n", printDouble(buffer1, value1), printDouble(buffer2, value2));
 
     printf("---\r\n");
 
-    magnetometer->Get_M_Axes(axes);
-    printf("LIS3MDL [mag/mgauss]:  %6ld, %6ld, %6ld\r\n", axes[0], axes[1], axes[2]);
+    magnetometer->get_m_axes(axes);
+    printf("LIS3MDL [mag/mgauss]:  %7ld, %7ld, %7ld\r\n", axes[0], axes[1], axes[2]);
 
-    accelerometer->Get_X_Axes(axes);
-    printf("LSM6DS0 [acc/mg]:      %6ld, %6ld, %6ld\r\n", axes[0], axes[1], axes[2]);
+    accelerometer->get_x_axes(axes);
+    printf("LSM6DS0 [acc/mg]:      %7ld, %7ld, %7ld\r\n", axes[0], axes[1], axes[2]);
 
-    gyroscope->Get_G_Axes(axes);
-    printf("LSM6DS0 [gyro/mdps]:   %6ld, %6ld, %6ld\r\n", axes[0], axes[1], axes[2]);
+    gyroscope->get_g_axes(axes);
+    printf("LSM6DS0 [gyro/mdps]:   %7ld, %7ld, %7ld\r\n", axes[0], axes[1], axes[2]);
 
     wait(1.5);
   }
--- a/mbed.bld	Thu Nov 24 16:19:41 2016 +0000
+++ b/mbed.bld	Fri Mar 24 10:14:11 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/d75b3fe1f5cb
\ No newline at end of file
+https://mbed.org/users/mbed_official/code/mbed/builds/093f2bd7b9eb
\ No newline at end of file