Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of DSP_200kHz by
Jareds_DSP/print_data.cpp@76:704fc58ffcd0, 2017-06-04 (annotated)
- Committer:
- baxterja
- Date:
- Sun Jun 04 02:41:14 2017 +0000
- Revision:
- 76:704fc58ffcd0
- Child:
- 77:1ee17a9e9f8b
Everything working well including printing. I'm about to change it so we only have one voltage and one current measurment.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
baxterja | 76:704fc58ffcd0 | 1 | #include "print_data.h" |
baxterja | 76:704fc58ffcd0 | 2 | |
baxterja | 76:704fc58ffcd0 | 3 | DigitalOut status_2(D2); |
baxterja | 76:704fc58ffcd0 | 4 | int printing_length = 0; |
baxterja | 76:704fc58ffcd0 | 5 | int printing_counter = 0; |
baxterja | 76:704fc58ffcd0 | 6 | char print_buffer[50]; |
baxterja | 76:704fc58ffcd0 | 7 | |
baxterja | 76:704fc58ffcd0 | 8 | void print_filter_data() |
baxterja | 76:704fc58ffcd0 | 9 | { |
baxterja | 76:704fc58ffcd0 | 10 | if (printing_counter>=printing_length) |
baxterja | 76:704fc58ffcd0 | 11 | return; |
baxterja | 76:704fc58ffcd0 | 12 | status_2 = 1; |
baxterja | 76:704fc58ffcd0 | 13 | if (printing_counter<printing_length) |
baxterja | 76:704fc58ffcd0 | 14 | { |
baxterja | 76:704fc58ffcd0 | 15 | printf("%C",print_buffer[printing_counter]); |
baxterja | 76:704fc58ffcd0 | 16 | printing_counter++; |
baxterja | 76:704fc58ffcd0 | 17 | } |
baxterja | 76:704fc58ffcd0 | 18 | status_2 = 0; |
baxterja | 76:704fc58ffcd0 | 19 | } |
baxterja | 76:704fc58ffcd0 | 20 | void set_print_buffer(float mag,float phase) |
baxterja | 76:704fc58ffcd0 | 21 | { |
baxterja | 76:704fc58ffcd0 | 22 | if (printing_counter<printing_length) |
baxterja | 76:704fc58ffcd0 | 23 | { |
baxterja | 76:704fc58ffcd0 | 24 | printf("PRINT OVERLOAD\n\r"); |
baxterja | 76:704fc58ffcd0 | 25 | } |
baxterja | 76:704fc58ffcd0 | 26 | printing_counter = 0; |
baxterja | 76:704fc58ffcd0 | 27 | printing_length=sprintf (print_buffer, "%.2E %.2f\n\r", mag, phase); |
baxterja | 76:704fc58ffcd0 | 28 | } |