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.
Dependencies: ADXL362 Lab7 mbed
Revision 1:ed3c12662b08, committed 2018-02-02
- Comitter:
- madfain
- Date:
- Fri Feb 02 23:05:39 2018 +0000
- Parent:
- 0:db770a1bef64
- Child:
- 2:1dab962fe6f0
- Commit message:
- Lab Three
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Feb 02 15:03:02 2018 +0000
+++ b/main.cpp Fri Feb 02 23:05:39 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)
@@ -167,6 +169,6 @@
else if (strstr(s_one, "SINE") != NULL){
sinecom(s_two);
}
- else pc.printf("Bad command, try again buddy \n\r");
+ else pc.printf("Bad command, try again buddy \n\r");
}
}
\ No newline at end of file