Hi All,
I am trying to get my spark to talk to the Adafruit LSM303 Accelerometer over I2C, I have them wired with 4K7 pullups and I have gone here
for the files for the unit from where I copied the .cpp and .h into tabs on a new Spark Build and tried to Verify and got errors about Wire.h so as this is included with the Spark I commented that out and then got lots of other errors like:
In file included from LSM303.cpp:1:0:
LSM303.h:163:12: error: 'int16_t' was not declared in this scope
vector<int16_t> a; // accelerometer readings
^
LSM303.h:163:19: error: template argument 1 is invalid
vector<int16_t> a; // accelerometer readings
^
LSM303.h:164:12: error: 'int16_t' was not declared in this scope
vector<int16_t> m; // magnetometer readings
^
LSM303.h:164:19: error: template argument 1 is invalid
vector<int16_t> m; // magnetometer readings
^
LSM303.h:165:12: error: 'int16_t' was not declared in this scope
vector<int16_t> m_max; // maximum magnetometer values, used for calibration
^
LSM303.h:165:19: error: template argument 1 is invalid
vector<int16_t> m_max; // maximum magnetometer values, used for calibration
I am tried looking around on this site and googling but to now avail, I am on the verge of writing the library’s from scratch in my own way but was hoping that someone could point me in the right direction of using these and getting it to work. I purchased the units from Adafruit and will hopefully need lots of them is the system works as I need but first I need to get it working.
Thanks
Cliff.