I am experiencinga slow sampling frequency whenever i try to print 3 sensor output on the serial monitor

i am experiencing slow sampling frequency whenever i try to print 3 sensor output on the serial monitor.

Th e serial.println(sensor Value), works properly when it is only one sensors output. However, it is slowing down whenever i print more than one sensor value on the serial monitor.
I am using adxl 313 connected via I2C and analog sensor on analog pin. I have VERIFIED ABOVE SITUATION FO R ALL SENSORS but not change.

is IT POSSIBLE deactivate the serial print and replace with another function ?
any further alternative ?

Thank you.

Certainly. Speed up your serial baud rate to the maximum speed it will work. Since I see no code, I cannot help with that. When your serial buffer fill up, it will block your program until it can add more to the buffer.

Hi, @raphaelengr
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".

This will help with advice on how to present your code and problems.

Thanks... Tom... :grinning: :+1: :coffee: :australia:

Please Read how to post your code.
Read post#3.

Tom... :grinning: :+1: :coffee: :australia:

should be volatile

Serial print is notoriously slow and will drag your loop. get a faster board. Any print out from the loop will slow it down.

A faster board will not help with that.

Chances are with so many serial calls it won’t solve the problem entirely, but it might make the rest of the code run faster therefore letting more time for prints.

Something else I noticed, looks like OP is printing to plotter with frequency of 1000 times a second. I’m sure this can be improved by the factor of 100. Printing 10 times a second while still collecting data 1000 times a second should already improve it if not solve it.

The only thing what will happen is that the board has to wait longer until serial printing is finished ...

I will repost in a better way,
Thanks for any further advise if any.

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