Skip to content

Commit

Permalink
bug fix with serial print debugging: avoid log(0) which gives inf in …
Browse files Browse the repository at this point in the history
…Arduino and this leads to unplotted points and unsynchronized traces in the graph
  • Loading branch information
corrados committed Apr 24, 2023
1 parent 4902d68 commit 86b9720
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion edrumulus.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ const float ADC_noise_peak_velocity_scaling = 1.0f / 6.0f;
{
for ( int j = 0; j < number_debug_buffers; j++ )
{
serial_print += String ( 10.0f * log10 ( debug_buffer[j][i % debug_buffer_size] ) ) + "\t";
serial_print += String ( 10.0f * log10 ( max ( 1e-3f, debug_buffer[j][i % debug_buffer_size] ) ) ) + "\t";
}
serial_print += "\n";
}
Expand Down

0 comments on commit 86b9720

Please sign in to comment.