Hello SparkFun friends. My kids and I are new to Arduino and, in connection with work I’m doing with Sandy Hook Promise, starting to experiment with how we’d build a tampering detector for firearms.
First step, we’ve acquired a SparkFun Arduino kit and one of these 10955 / MMA8542Q accelerometer breakout boards. And, we quickly got stuck. Here’s what we’ve done:
Here’s how we connected things:
10955 / Arduino 3.3V => 3.3V Gnd => Gnd SDA => A4 SCL => A5 ID1 => 1 ID2 => 2
I haven’t added any circuitry to pull up the 3.3V logic signals to 5V — it sounded from the discussion like that shouldn’t be necessary. (Am I missing something?)
We’re using the code and libraries linked below, and it’s hanging so long as the SCL pin is connected.
Here’s the relevant code:
include
include
MMA8453_n0m1 accel;
void setup() { Serial.begin(9600); accel.setI2CAddr(0x1d); I2c.begin(); accel.dataMode(true, 2); }
In particular, the call to accel.dataMode(true, 2) doesn’t return if SCL is connected. Removing SCL connection, it proceeds into loop() but there’s (obviously) no meaningful data coming through.
Stuff I’ve tried that doesn’t change behavior: – adding I2c.begin() – disconnecting I1/I2 – either address 0x1c to 0x1d
Seems strange to me that the behavior is the same regardless of address.
Thanks for advice!