Esta última actualización contiene el código funcional en las 10 funciones.

Dependencies:   mbed

Fork of jc by Sist. Piccolo

Revision:
1:a9b3fdab473e
Parent:
0:9aa960516df7
Child:
2:773082426491
--- a/main.cpp	Mon Nov 20 04:28:42 2017 +0000
+++ b/main.cpp	Tue Nov 21 20:05:14 2017 +0000
@@ -212,7 +212,7 @@
             {
                 yp =m*xp+b;
                 vertex2d(xp,yp,abajo);
-               // savep( buffer_POS[INITPARAMETER==02]buffer_POS[INITPARAMETER+1==xp], buffer_POS[INITPARAMETER+2==xf],buffer_POS[INITPARAMETER+3==yp], buffer_POS[INITPARAMETER+4==yf]);
+               savep();
                 
          #if DEBUG
             Sdebug.printf("coord X = %f,coord Y = %f \n", xp,yp);
@@ -305,7 +305,7 @@
     
     
     
-    void savep(float pos){
+    void savep(){
          for (uint8_t i=0; i<BUFF_POS;i++)
         {
             buffer_command[i]=command.getc();
@@ -323,10 +323,11 @@
         
     
 void pause(){
-       p=1;
-       led = !led;                            
-    timeout.attach(&pause, 300);
-    // while(1);
+       
+       timeout.attach(&pause, 0.5);                            
+       wait (5);
+           
+    
     
     
     }
@@ -430,27 +431,14 @@
 }
 
 
-    
-
-
-    
-        
-     
-     
-
-int main() {
-    #if DEBUG
-    command.printf("inicio con debug\n");
-    #else
-    command.printf("inicio sin debug\n");
-    #endif
-     uint8_t val;
+    void interrupcion(){
+         uint8_t val;
    // mybutton.rise(&stop);
     while(1){
     val=command.getc();
         if (val== '<'){
             Read_command();
-          //  ticker1.attach(&Read_command,05);
+            mybutton.rise(&pause);
             if (check_command()){
                 command_exe();
             }
@@ -466,12 +454,30 @@
                  command.printf("error de inicio de trama: ");
                  command.putc(val);
                 #endif
-                }
+        
+           }
+          }
+        }
+
+
+    
+        
+     
+     
+
+int main() {
+    #if DEBUG
+    command.printf("inicio con debug\n");
+    #else
+    command.printf("inicio sin debug\n");
+    #endif
+    ticker1.attach(&interrupcion,0.5);
+    for(;;);
+                
                 
             }
         
                 
-    //ticker1.attach(&main,05);
+    
     
 
-} 
\ No newline at end of file