Notifications
Clear all

Problem with ADXL357 with DFROBOT FIREBETTLE I2C

5 Posts
4 Users
3 Likes
509 Views
(@abdul)
Member
Joined: 1 year ago
Posts: 14
Topic starter  

   
Quote
Topic Tags
(@abdul)
Member
Joined: 1 year ago
Posts: 14
Topic starter  

Below is the output; I welcome any input.

0.00,0.00,0.00
0.00,0.00,0.00
0.00,0.00,0.00
0.00,0.00,0.00
0.00,0.00,0.00
0.00,0.00,0.00
0.00,0.00,0.00

   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7008
 

@harri_son Standard procedure is to state what you expect to happen, what did happen, supply just enough code to cover the situation and if you don't know what code is affected then how will we?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
DaveE reacted
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2535
 

@harri_son 

Your sketch is incomplete, there are no pin definitions nor pinMode settings.

Also, your assignment of the address of ADXL357 is inconsistent, you should change either of the values to match the other.

int ADXL357 = 29;                     // ADXL357 I2C address - 0x53

Also, why do you convert data to float before comparing it to the largest integer ?

 

Anything seems possible when you don't know what you're talking about.


   
DaveE reacted
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1695
 

Hi @harri_son,

  Sorry, I have only glanced at your code, and I am not familiar with what you are trying to do, but I concur with Ron (@zander), that you need to focus on what is happening and what you expect to happen.

e.g. So far as I can see, none of the code below the end of the function readZ is currently able to be called, and thus is either irrelevant at this point ... or maybe it needs to be 'activated' to make something happen.

Figure out how your program works, step and step, and use print statements, etc. to check each step from the first one.

Good luck, Dave

 

   
Ron reacted
ReplyQuote