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
Fork of Lab2 by
Revision 1:9fe22ab77011, committed 2018-03-03
- Comitter:
- kmhatre
- Date:
- Sat Mar 03 01:07:04 2018 +0000
- Parent:
- 0:9439aa91d4cb
- Child:
- 2:b641c02f2844
- Commit message:
- Resistor Networks/Multimeter
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| report.txt | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Feb 06 10:34:11 2018 +0000
+++ b/main.cpp Sat Mar 03 01:07:04 2018 +0000
@@ -129,8 +129,10 @@
}
else
{
- pc.printf("Voltag is %f\n\r", volt);
- my_output.write_u16(volt*19720);
+ float adjust = (0x7FFF/2)+(0x7FFF/10);
+
+ pc.printf("Voltage is %f\n\r", volt);
+ my_output.write_u16(volt*adjust);
pc.printf("Voltage changed\n\r");
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/report.txt Sat Mar 03 01:07:04 2018 +0000 @@ -0,0 +1,38 @@ + +Circuit 1 ideal analysis: + V1 = 2.5V + V2 = 1.719V + R1 = 1k ohm + R2 = 2.2k ohm + RT = 3.2k ohm + I = 781.25 uA + + + +Circuit 1 Measurement: + V1 = 2.501V + V2 = 1.717V + + + +Circuit 2 ideal analysis: + V1 = 2.1V + R1 = 1k ohm + + R2 = 2.2k ohm + V2 = 1.354V + + R3 = 10k ohm + R4 = 470 ohm + R5 = 1.5k ohm + +Circuit 2 Measurement: + V1 = 2.1V + V2 = 1.352V + V3 = 0.047V + + +The major difficulty in this assignment was to figure out the adjusting the multiplying number to get the right output. +I tried different methods but finally played around with the range given to us 0x7FFF. +I divided this into two and added one tenth of it by trial and error in the lab. +So the final adjustment is multiplying 60% of 0x7FFF to the given voltage. \ No newline at end of file
