Hi All!
I am starting off my Spark adventure with trying to get the 9-DOF Adafruit LSM9DS0 (http://www.adafruit.com/products/2021?&main_page=product_info&products_id=2021) to work on Spark.
I realize that I cannot take the Adafruit libraries 1:1 to Spark (I got the SSD1306 OLED to work through the ported files on this forum - thanks!), but I am hoping the problems I am currently having in compiling are simply related to including other dependent libraries in the wrong way.
Reading https://learn.adafruit.com/adafruit-lsm9ds0-accelerometer-gyro-magnetometer-9-dof-breakouts/wiring-and-test it seems like I need the following libraries:
So I have copy-pasted these files into the IDE environment, now having:
- Adafruit_Sensor.cpp
- Adafruit_Sensor.h
- Adafruit_LSM9DS0.cpp
- Adafruit_LSM9DS0.h
- lsm9doftest.ino
I followed the example of another thread to replace “Arduino.h” in the listed files above with:
define ARDUINO_H
’#include <stdint.h>
’#include <stddef.h>
’#include <stdlib.h>
…but I hasn’t resolved all my issues.
I removed the “Wire.h” file believing it is part of Spark environment anyway, and I removed “SPI.h” since I am using I2C.
’#include <Wire.h>
’#include <SPI.h>
I am a bit skeptical to #include “avr/pgmspace.h” in the "Adafruit_Sensor.cpp, mainly because I don’t know what it does (flash related??).
I am just brushing off my Very old C++ programming skills, so bare with me…
Files can be found here: https://github.com/heon74/LSM9DS0_9DOF:
When I compile I get errors as below…can anyone point me in the right direction?
Thanks!
In file included from Adafruit_LSM9DS0.cpp:15:0:
Adafruit_LSM9DS0.h:194:27: error: ‘boolean’ has not been declared
void write8 ( boolean type, byte reg, byte value );
^
Adafruit_LSM9DS0.h:194:41: error: ‘byte’ has not been declared
void write8 ( boolean type, byte reg, byte value );
^
Adafruit_LSM9DS0.h:194:51: error: ‘byte’ has not been declared
void write8 ( boolean type, byte reg, byte value );
^
Adafruit_LSM9DS0.h:195:5: error: ‘byte’ does not name a type
byte read8 ( boolean type, byte reg);
^
Adafruit_LSM9DS0.h:196:5: error: ‘byte’ does not name a type
byte readBuffer ( boolean type, byte reg, byte len, uint8_t buffer);
^
Adafruit_LSM9DS0.h:247:5: error: ‘boolean’ does not name a type
boolean _i2c;
^
Adafruit_LSM9DS0.h: In member function 'virtual void Adafruit_LSM9DS0::Sensor::getEvent(sensors_event_t)’:
Adafruit_LSM9DS0.h:226:46: error: ‘millis’ was not declared in this scope
(_parent->*_eventFunc)(event, millis());
^
Adafruit_LSM9DS0.cpp: In constructor ‘Adafruit_LSM9DS0::Adafruit_LSM9DS0(int32_t)’:
Adafruit_LSM9DS0.cpp:22:3: error: ‘_i2c’ was not declared in this scope
_i2c = true;
^
Adafruit_LSM9DS0.cpp: In constructor ‘Adafruit_LSM9DS0::Adafruit_LSM9DS0(int8_t, int8_t, int32_t)’:
Adafruit_LSM9DS0.cpp:34:3: error: ‘_i2c’ was not declared in this scope
_i2c = false;
^