Gustavo Vargas Melo / Mbed 2 deprecated BotonFinal

Dependencies:   mbed FXOS8700Q

Files at this revision

API Documentation at this revision

Comitter:
akumagame
Date:
Fri Apr 24 23:13:33 2020 +0000
Parent:
6:14523b016fd5
Commit message:
f

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Apr 22 23:27:19 2020 +0000
+++ b/main.cpp	Fri Apr 24 23:13:33 2020 +0000
@@ -3,29 +3,39 @@
 
 Serial com1(USBTX, USBRX);
 
-DigitalIn bot(PTA6);
- 
- 
- int main()
+DigitalIn  bot(PTC6);
  
-  {
-     while(1)
-     
+ void boton(int bar)
+{
+  
+     if(bar==0)
      {
-     if(bot.read()== 0)
-     {
-        com1.printf("El boton esta siendo presionado");
+        com1.printf("El boton esta siendo presionado\n");
     
          }
          
          else
          {
-        com1.printf("El boton esta no esta siendo presionado" );
+        com1.printf("El boton esta no esta siendo presionado\n" );
         
              }
             
-     }
+    
   
+ }
+ 
+ int main()
+ 
+  {
+    while(1)
+    {
+    int x;
+    x = bot.read();
+    boton(x);
+
+  
+
+  }
   }