Notifications
Clear all

ADXL345 SPI output 000 on the serial monitor

17 Posts
4 Users
2 Likes
268 Views
Ron
 Ron
(@zander)
Illustrious Member
Joined: 3 years ago
Posts: 4805
 

@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.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Will
 Will
(@will)
Famed Member
Joined: 2 years ago
Posts: 2326
 

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.

 

Experience is what you get when you don't get what you want.


   
Ron reacted
ReplyQuote
Page 2 / 2