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.
Diff: main.cpp
- Revision:
- 6:0d854548023b
- Parent:
- 5:ff47bcaebc64
- Child:
- 7:1f0ab6c43458
diff -r ff47bcaebc64 -r 0d854548023b main.cpp
--- a/main.cpp Sun Mar 06 15:24:02 2016 +0000
+++ b/main.cpp Tue Mar 08 07:41:12 2016 +0000
@@ -29,9 +29,9 @@
while(1)
{
- //MassCompute(voltage.read());
- //SerialTransmit();
- pc.printf("%d",test);
+ MassCompute(voltage.read());
+ SerialTransmit();
+ //pc.printf("%d",test);
wait_ms(SAMPLE_TIME); //Wait for 100ms, this is the sample time.
}
}
@@ -54,15 +54,15 @@
void SerialTransmit(void)
{
- unsigned int start,end;
+ unsigned short int start,end;
start = 0xfe;
end = 0xff;
if(mass>3)
mass =3;
- mass_trans_low = (int)(mass*10000);
- mass_trans_high = (int)(mass*10000)>>8;
- pc.printf("%d",start);
- pc.printf("%d",mass_trans_high);
- pc.printf("%d",mass_trans_low);
- pc.printf("%d",end);
+ mass_trans_low = (unsigned int)(mass*10000);
+ mass_trans_high = (unsigned int)(mass*10000)>>8;
+ pc.printf("%u",start);
+ pc.printf("%u",mass_trans_high);
+ pc.printf("%u",mass_trans_low);
+ pc.printf("%u",end);
}
\ No newline at end of file