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 0:029c836ac188, committed 2014-09-09
- Comitter:
- m161440
- Date:
- Tue Sep 09 01:06:51 2014 +0000
- Commit message:
- lab 2 exercise 1
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Exercise1.cpp Tue Sep 09 01:06:51 2014 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+Serial pc(USBTX, USBRX);
+AnalogIn voltage(p20);
+
+ int main()
+ {
+ pc.baud(921600);
+
+
+ while(1)
+ {
+ float v= voltage;
+ voltage.read();
+ printf("analog value = %f\n",v);
+ printf("voltage = %f \n",3.3*v);
+ wait(.5);
+ }
+
+
+ }
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Sep 09 01:06:51 2014 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+Serial pc(USBTX, USBRX);
+AnalogIn voltage(p20);
+
+ int main()
+ {
+ pc.baud(921600);
+
+
+ while(1)
+ {
+ float v= voltage;
+ voltage.read();
+ printf("analog value = %f\n",v);
+ printf("voltage = %f \n",3.3*v);
+ wait(.5);
+ }
+
+
+ }
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Sep 09 01:06:51 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013 \ No newline at end of file