Accelerometer with MMA8451 with Arduino not working

Hello,
I’m using an arduino uno GT016 with an accelerometer

Using the link above which gives the wiring connections and the arduino code as well, but
when I follow the instructions and do the same, the “if condition” in the code runs where they have the mma.begin(), so I think its a problem with the accelerometer not working.

Are there any other solutions or am I not doing things right?

if (! mma.begin()) {
    Serial.println("Couldnt start");
    while (1);
  }```

Try removing the space after !

that space is totally legit…

What Arduino are you using?

Can you post a clear photo of your wiring?

Thanks for letting me know. :grinning:

I’m using the Go Tronic GT016
As for the wiring its the same as the wiring shown in the pdf
But see below

The gnd is connected to the AREF on the arduino
SCL to A5
SDA to A4
Vin to 5V on arduino

Hi,

The gnd of the protoboard should be connected to the gnd of the UNO not Vref.
Look closer at the picture from Adafruit and the description.

Tom… :grinning: :+1: :coffee: :australia:

I suppose you mean AREF
it’s hard to see on @ arno117’s picture where the black cable goes (indeed it should be plugged into GND)

1 Like

Thank you so much, it was completely my idoicy

don’t worry we all have been there and with age (even with glasses) it’s easy to get the wrong pin…

:scream: :grimacing: :innocent:

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.