0

Arduino Uno not detecting ADXL343
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Arduino Uno not detecting ADXL343

by vjxun on Fri Jun 14, 2019 11:01 am

I'm on a Windows PC with Arduino 1.8.9. I wired the ADXL343 according to the Adafruit tutorial, substituting SDA/SCL with A4/A5 respectively. However, I keep getting this error message:

Ooops, no ADXL343 detected ... Check your wiring!

Wondering if there's anything I'm missing in the code. Anything I can do to troubleshoot?

vjxun
 
Posts: 3
Joined: Fri Jun 14, 2019 10:47 am

Re: Arduino Uno not detecting ADXL343

by vjxun on Fri Jun 14, 2019 11:18 am

Update: I restarted Arduino and now the console log displays the following warnings:

Code: Select all | TOGGLE FULL SIZE
C:\Users\jzhang\Documents\Arduino\libraries\Adafruit_ADXL345\Adafruit_ADXL345_U.cpp: In member function 'uint8_t Adafruit_ADXL345_Unified::readRegister(uint8_t)':

C:\Users\jzhang\Documents\Arduino\libraries\Adafruit_ADXL345\Adafruit_ADXL345_U.cpp:107:42: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:

     Wire.requestFrom((uint8_t)_i2caddr, 1);

                                          ^

In file included from C:\Users\jzhang\Documents\Arduino\libraries\Adafruit_ADXL345\Adafruit_ADXL345_U.cpp:29:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:64:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int)

     uint8_t requestFrom(int, int);

             ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:61:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)

     uint8_t requestFrom(uint8_t, uint8_t);

             ^

C:\Users\jzhang\Documents\Arduino\libraries\Adafruit_ADXL345\Adafruit_ADXL345_U.cpp: In member function 'int16_t Adafruit_ADXL345_Unified::read16(uint8_t)':

C:\Users\jzhang\Documents\Arduino\libraries\Adafruit_ADXL345\Adafruit_ADXL345_U.cpp:129:42: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:

     Wire.requestFrom((uint8_t)_i2caddr, 2);

                                          ^

In file included from C:\Users\jzhang\Documents\Arduino\libraries\Adafruit_ADXL345\Adafruit_ADXL345_U.cpp:29:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:64:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int)

     uint8_t requestFrom(int, int);

             ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:61:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)

     uint8_t requestFrom(uint8_t, uint8_t);

             ^

C:\Users\jzhang\Documents\Arduino\libraries\Adafruit_ADXL343/Adafruit_ADXL343.h:102:3: warning: type 'range_t' violates one definition rule [-Wodr]

 } range_t;

   ^

C:\Users\jzhang\Documents\Arduino\libraries\Adafruit_ADXL345\Adafruit_ADXL345_U.h:107:3: note: an enum with different value name is defined in another translation unit

 } range_t;

   ^

C:\Users\jzhang\Documents\Arduino\libraries\Adafruit_ADXL343/Adafruit_ADXL343.h:93:3: warning: type 'dataRate_t' violates one definition rule [-Wodr]

 } dataRate_t;

   ^

C:\Users\jzhang\Documents\Arduino\libraries\Adafruit_ADXL345\Adafruit_ADXL345_U.h:98:3: note: an enum with different value name is defined in another translation unit

 } dataRate_t;

   ^

Sketch uses 8262 bytes (25%) of program storage space. Maximum is 32256 bytes.
Global variables use 822 bytes (40%) of dynamic memory, leaving 1226 bytes for local variables. Maximum is 2048 bytes.

vjxun
 
Posts: 3
Joined: Fri Jun 14, 2019 10:47 am

Re: Arduino Uno not detecting ADXL343

by adafruit_support_bill on Fri Jun 14, 2019 12:22 pm

Those messages are just warnings. Recent versions of the IDE are much more aggressive in checking for potential programming problems.

Please post some photos showing your soldering and connections. The runtime error seems to indicate some connectivity problem.

adafruit_support_bill
 
Posts: 74629
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.