DIENTE DE SIERRA

Dependencies:   mbed

Revision:
0:21869cfbd794
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Feb 08 03:08:14 2020 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+Serial PC(PA_2,PA_3,115200);
+
+AnalogOut Aout (PA_4);
+AnalogIn Ain (PC_1);
+float lectura;
+float i=0;
+
+int main() {
+    while(1) {
+        for (i=0; i<1; i++){
+            Aout =1;
+            lectura=Ain.read();
+            PC.printf("%1.0f \r\n",lectura);
+            wait(0.5);
+            }
+        for (i=0; i<1; i++){
+            Aout =0;
+            lectura=Ain.read();
+            PC.printf("%1.0f \r\n",lectura);
+            wait(0.5);
+        }
+        }
+    }