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 13:8db371de14a7, committed 2016-03-08
- Comitter:
- lyreliu
- Date:
- Tue Mar 08 14:36:02 2016 +0000
- Parent:
- 12:623f562fc3db
- Child:
- 14:b67ce99ccd48
- Commit message:
- program test
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Mar 08 14:01:32 2016 +0000 +++ b/main.cpp Tue Mar 08 14:36:02 2016 +0000 @@ -38,14 +38,14 @@ } } -void MassCompute(float voltage) +void MassCompute(float vol) { //float ratio; //The amplified factor of the OA float vol_ref; //Reference voltage, the basic voltage of the MCU, the default number is 3.3 vol_ref = 3.3; - mass = 3000*vol_ref*voltage/RATIO + 0.3; //The compute function of mass from the voltage + mass = 3000*vol_ref*vol/RATIO + 0.3; //The compute function of mass from the voltage } void SerialInit(void) @@ -73,7 +73,8 @@ pc.printf("%c",start); //pc.printf("%c",mass_trans_high); //pc.printf("%c",mass_trans_low); - pc.printf("%c",voltage_test); - //pc.printf("%c",voltage_low); + + pc.printf("%c",voltage_high); + pc.printf("%c",voltage_low); pc.printf("%c",end); } \ No newline at end of file