lsm303

I’m running the Zumo SumoCollisionDetect sketch. Let me start off by saying I have two Zumo’s that I’ve put together. I have one Arduino UNO R3 SMD and I have one OSEPP UNO (also a SMD) The sketch runs fine on both shields with the Arduino UNO R3 SMD but it goes out to lunch on the OSEPP UNO at the lsm303.readAcceleration(loop_start_time); on line 222. I’ve really never seen someone derive a class in a sketch and my C++ isn’t anything that I know or use. It’s also a little weird that you have a LSM303 and an lsm303 in the same sketch.

Anyway all that being said, I’m guessing I have something going on with a register difference between the two boards but I can’t read C++ or figure out what the heck is going on in the derived class.

Have any ideas on how I can troubleshoot further … ?

Hello.

You mentioned that the sketch was working with the official Arduino Uno board, but not with the OSEPP Uno. I suspect there might be an issue with that Arduino clone. I suggest checking its datasheet to see if there are any differences in the I2C lines. If you have another device that uses I2C, you might try connecting it to your Uno clone to determine if that interface works.

As for the names, “LSM303” is the name of the accelerometer class, and the “SumoCollisionDetect” sketch extends that class as “Accelerometer” and then creates an instance of “Accelerometer” called “lsm303”.

-Jon