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.
Revision 1:bafc6db426c3, committed 2018-02-02
- Comitter:
- dprowe
- Date:
- Fri Feb 02 18:00:06 2018 +0000
- Parent:
- 0:904d2d8522b1
- Commit message:
- tHE THIRD LAB
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Feb 02 01:40:26 2018 +0000
+++ b/main.cpp Fri Feb 02 18:00:06 2018 +0000
@@ -54,13 +54,15 @@
pc.printf("Frequency: %f \n\r",input_f);
float wait_time = -9.955923 + (20817940 + 9.955923) / (1 + powf(input_f/0.0007111212, 1.049561)); //took data points and got this equation by estimating the graph with computer, results in 1-3% error
- while(1) {
+
+ while(!pc.readable()) {
// sinewave output
for (int i = 0; i < BUFFER_SIZE; i++) {
Vout.write_u16(buffer[i]/(3.30 * (1.00/inV)));
- wait_us(wait_time);
+ wait_us((int)wait_time);
}
}
+ return;
}
void ledcom(char* onoff)