Read and store X_NUCLEO_IKS01A1 data. Also calculates compass heading.
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Dependents: HelloWorld_IKS01A1
Fork of X_NUCLEO_IKS01A1 by
Revision 10:cdf47a4b3f2f, committed 2015-04-29
- Comitter:
- Wolfgang Betz
- Date:
- Wed Apr 29 16:14:03 2015 +0200
- Parent:
- 9:b989c9bc2f3e
- Child:
- 11:001a21c6ac1d
- Child:
- 14:298bc52b4a70
- Commit message:
- Added some important safety checks
Changed in this revision
| x_nucleo_iks01a1.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/x_nucleo_iks01a1.cpp Mon Apr 20 11:42:38 2015 +0200
+++ b/x_nucleo_iks01a1.cpp Wed Apr 29 16:14:03 2015 +0200
@@ -73,7 +73,9 @@
if(_instance == NULL) {
if(ext_i2c == NULL)
ext_i2c = new DevI2C(IKS01A1_PIN_I2C_SDA, IKS01A1_PIN_I2C_SCL);
- _instance = new X_NUCLEO_IKS01A1(ext_i2c);
+
+ if(ext_i2c != NULL)
+ _instance = new X_NUCLEO_IKS01A1(ext_i2c);
if(_instance != NULL) {
bool ret = _instance->Init();
William Thenaers
