Notifications
Clear all

ADXL345 SPI output 000 on the serial monitor

17 Posts
4 Users
2 Reactions
1,602 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7283
 

@harri_son It would be helpful to know your background, especially how many years of software development experience you have and in what languages and fields.

The second thing is, what is this project for, your Job, school exercise, or some hobby-related purpose?

By knowing these things, we can better address your issues.

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2548
 

Posted by: @abdul

The serial monitor output is attached. I want to do the FFT of the data, but I don't know the "t" to use. Whether from the timestamp (the laptop time) or I should use Serial.print(micros());

The timestamp is attached below.

09:50:36.276 -> 0.39,-0.23,9.45
09:50:36.276 -> 0.55,-0.39,9.37
09:50:36.276 -> 0.62,-0.31,9.53
09:50:36.276 -> 0.39,-0.39,9.53
09:50:36.276 -> 0.78,-0.47,9.45
09:50:36.276 -> 0.55,-0.16,9.30
09:50:36.276 -> 0.55,-0.31,9.45
09:50:36.276 -> 0.55,-0.23,9.30

The Serial.print(micros()) is attached below.

73119143,0.62,-0.31,9.37
73119859,0.55,0.00,9.69
73120559,0.47,-0.31,9.37
73121288,0.78,-0.39,9.37
73122010,0.39,-0.23,9.61
73122727,0.55,-0.31,9.30
73123452,0.55,-0.31,9.37
73124179,0.55,-0.39,9.61
73124895,0.55,-0.39,9.53
73125617,0.62,-0.23,9.61
73126342,0.47,-0.16,9.37
73127062,0.39,-0.16,9.22

You'll have to use micros() for timing, the timestamps you show are inserted by the IDE onto the serial output and are not available to your sketch.

 

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


   
Ron reacted
ReplyQuote
Page 2 / 2