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
Diff: main.cpp
- Revision:
- 0:3baa1aba5c61
diff -r 000000000000 -r 3baa1aba5c61 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Nov 26 23:48:02 2015 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+#include "AnalogIn.h"
+
+AnalogIn leer(PTC2);
+Serial pc(USBTX,USBRX);
+
+int main(void)
+{
+ float voltaje;
+ uint16_t adcvalue;
+ pc.baud(115200);
+
+ while(1){
+ adcvalue = leer.read_u16();
+ voltaje = adcvalue*3.3/65525;
+ pc.printf("el voltaje es %.2f\r\n", voltaje);
+ wait(0.8);
+ }
+
+}
\ No newline at end of file