Working code for pc app 12/01/2018 commit

Dependencies:   mbed MS5607 mbed-dsp

Fork of Turrentine_Code by Alex Stokoe

Files at this revision

API Documentation at this revision

Comitter:
AlexStokoe
Date:
Wed Feb 14 10:40:30 2018 +0000
Parent:
8:206c2ae7f49f
Commit message:
Release to MSA 1.1

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Feb 13 18:08:53 2018 +0000
+++ b/main.cpp	Wed Feb 14 10:40:30 2018 +0000
@@ -37,6 +37,7 @@
 arm_rfft_fast_instance_f32 rfft;
 
 float duty = 1;
+float sampleRate;
 
 int round(float number)
 {
@@ -139,7 +140,8 @@
         
         //Output iteration data
         iter_counter++;
-        printf("$DATA %.2f,%.2f,%.1f,%.1f,%1.5e,%.1f\n", iter_timer.read(), 1000000 / (sample_timer.read_us() / N_SAMPLES), f_data[0] / N_SAMPLES, max_mag_i, sum, t90);
+        sampleRate = 1000000 / (sample_timer.read_us() / N_SAMPLES);
+        printf("$DATA %.2f,%.2f,%.1f,%.1f,%1.5e,%.1f\n", iter_timer.read(), sampleRate , f_data[0] / N_SAMPLES, (max_mag_i * sampleRate / N_SAMPLES), sum, t90);
         
         //Set LEDs based on thresholds
         for(int i = 0; i < N_LEDS; i++) {