Sz_Insper / Mbed 2 deprecated DAC_waveform_V2

Dependencies:   mbed

Revision:
1:a0a660d54a0b
Parent:
0:cdadc6b7f2d1
--- a/main.cpp	Fri May 29 18:35:12 2020 +0000
+++ b/main.cpp	Fri May 29 19:23:13 2020 +0000
@@ -24,7 +24,7 @@
 
 void seno()
 {
-while(j!=100){
+while(j!=25){
     j++;
     for (int i=0; i <361; i++) {
 
@@ -36,19 +36,19 @@
 
         Bus = n;
 
-        // pc.printf("\r\t%1.3f\n",valor);
-         wait_ms(100);
-
+        //pc.printf("\r\t%1.3f\n",valor);
+         wait_ms(1);
 }
 
     }
 
+
 }
 
 void serra()
 {
-    for(int i = 0; i<=15; i++) {
-        Bus = i;
+    for(int i = 0; i<8; i++) {
+        Bus = i*7;
         valor = 3.3*Ain.read();
         //pc.printf("\r\t%1.3f\n",valor);
         wait_ms(100);
@@ -61,7 +61,7 @@
         Bus =  (i/10)*15;
         wait_ms(100);
         valor = 3.3*Ain.read();
-        // pc.printf("\r\t%1.3f\n",valor);
+        //pc.printf("\r\t%1.3f\n",valor);
 
 
     }
@@ -110,8 +110,9 @@
 
 
         case 4:
-          for (int i=30; i<40; i++) {
+          for (int i=30; i<35; i++) {
             contador = 0;
+            j =0;
             }
             break;
 
@@ -121,7 +122,7 @@
 int main()
 {
 
-    button.fall(&wave);
+    button.rise(&wave);
 
 
 }
\ No newline at end of file