lsm9ds1 IMU get tilt along specified axis returns error: ...'__imuS' undeclared (first use)
dgately
Posts: 1,630
Howdy,
Looks like the built code for this LSM9DS1 sensor includes an undeclared variable, '__imuS ' when compiling with BlocklyProp. It gives an error when trying to use the LSM9DS1 IMU's: "gets tilt along specified axis" command...
Error:
C code created:
dgately
Looks like the built code for this LSM9DS1 sensor includes an undeclared variable, '__imuS ' when compiling with BlocklyProp. It gives an error when trying to use the LSM9DS1 IMU's: "gets tilt along specified axis" command...
Error:
Required libraries: lsm9ds1, simpletools Library compile order: None needed single.c: In function 'main': single.c:29:28: error: '__imuS' undeclared (first use in this function) single.c:29:28: note: each undeclared identifier is reported only once for each function it appears in
C code created:
/* SERIAL_TERMINAL USED */ // ------ Libraries and Definitions ------ #include "simpletools.h" #include "lsm9ds1.h" // ------ Global Variables and Objects ------ float __imuX, __imuY, __imuZ, __compI; int z_tilt; int item; int z_angle; // ------ Main Program ------ int main() { imu_init(12, 13, 14, 15); while (1) { imu_readAccelCalculated(&__imuX, &__imuY, &__imuZ); z_tilt = (int)(100.0 * __imuX); item = (int)(100.0 * __imuY); z_angle = (int)(100.0 * __imuZ); print(("angle: ")); print("%d\r", z_angle); imu_readAccelCalculated(&__imuX, &__imuY, &__imuZ); item = (int)(atan2(__imuS, __imuY) * 180.0 / PI); // <-- __imuS is UNDECLARED z_tilt = (int)(atan2(__imuZ, __imuY) * 180.0 / PI); print(("tilt: ")); print("%d\r", z_tilt); } }
dgately
Comments
Thanks!
Matt
Thanks,
Matt
dgately