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: Exercise1.cpp
- Revision:
- 0:029c836ac188
--- /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