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: mbed
Repository for the 2015 OhmBoyZ Capstone group.
Revision 1:d901038c4bd2, committed 2015-11-17
- Comitter:
- Krabby127
- Date:
- Tue Nov 17 17:26:59 2015 +0000
- Parent:
- 0:cbee968c2ec3
- Child:
- 2:a17facee23c1
- Commit message:
- Updated comments for readability
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Nov 17 17:19:01 2015 +0000 +++ b/main.cpp Tue Nov 17 17:26:59 2015 +0000 @@ -13,16 +13,17 @@ while(1) { meas = analog_value.read(); // Converts and read the analog input value (value from 0.0 to 1.0) meas = meas * 3300; // Change the value to be in the 0 to 3300 range (currently to mV) - b=meas/(4.0*12.2*100.0); // Based 9h - printf("meas = %fmV\n\r",meas); - printf("b = %f Gauss\n\r",b); + printf("meas = %fmV\n\r",meas); // Print out raw measurement in terms of mV + b=meas/(4.0*12.2*100.0); // Based on equation 1 + printf("b = %f Gauss\n\r",b); // Print out b field measure in Gauss printf("B = %fuT\n\r", b*100.0); // Output B field in micro-Tesla - if (meas > 2000) { // If the value is greater than 2V then switch the LED on (greater than + if (meas > 2000) { // If the value is greater than 2V then switch the LED on + // greater than 410 microGauss [40 mT] led = 1; } else { led = 0; } - wait(1.0); // 1 s + wait(1.0); // wait 1 second } }