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@77:1ee17a9e9f8b, 2017-06-05 (annotated)
- Committer:
- baxterja
- Date:
- Mon Jun 05 18:09:37 2017 +0000
- Revision:
- 77:1ee17a9e9f8b
- Parent:
- 76:704fc58ffcd0
- Child:
- 78:10b2916b8f5c
Fixed printing problem. Made it so it so that ADC 0 only reads one pin & doesn't flip flop.
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 | 77:1ee17a9e9f8b | 3 | DigitalOut status_2(D4); |
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 | 77:1ee17a9e9f8b | 8 | |
baxterja | 77:1ee17a9e9f8b | 9 | void print_filter_data(Serial *pc) |
baxterja | 76:704fc58ffcd0 | 10 | { |
baxterja | 76:704fc58ffcd0 | 11 | if (printing_counter>=printing_length) |
baxterja | 76:704fc58ffcd0 | 12 | return; |
baxterja | 76:704fc58ffcd0 | 13 | status_2 = 1; |
baxterja | 77:1ee17a9e9f8b | 14 | //printf("Y"); |
baxterja | 77:1ee17a9e9f8b | 15 | pc->printf("%c",print_buffer[printing_counter]); |
baxterja | 77:1ee17a9e9f8b | 16 | printing_counter++; |
baxterja | 77:1ee17a9e9f8b | 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 | 77:1ee17a9e9f8b | 22 | |
baxterja | 76:704fc58ffcd0 | 23 | if (printing_counter<printing_length) |
baxterja | 76:704fc58ffcd0 | 24 | { |
baxterja | 76:704fc58ffcd0 | 25 | printf("PRINT OVERLOAD\n\r"); |
baxterja | 76:704fc58ffcd0 | 26 | } |
baxterja | 77:1ee17a9e9f8b | 27 | |
baxterja | 77:1ee17a9e9f8b | 28 | printing_length=sprintf (print_buffer, "%E %f\n\r", mag, phase); |
baxterja | 76:704fc58ffcd0 | 29 | printing_counter = 0; |
baxterja | 77:1ee17a9e9f8b | 30 | |
baxterja | 76:704fc58ffcd0 | 31 | } |