Practica_6_-_Ejercicio_03

Dependencies:   mbed TextLCD Keypad

Revision:
27:eb32f100130f
Parent:
26:29f649949409
Child:
28:868b283c5f77
--- a/main.cpp	Fri Oct 04 16:19:52 2019 +0000
+++ b/main.cpp	Tue Oct 08 18:38:01 2019 +0000
@@ -1,36 +1,21 @@
 #include "mbed.h"
 Serial pc(USBTX,USBRX);
 
+//Funcion sin argumento y con retorno
 
-void funcion1(void); //Funcion sin argumento y sin regreso de dato 
-void funcion2(char);//Funcion con argumento y sin retorno
+int funcion3(void); 
+
 
  int main()
 {
-    funcion1();
-    while (1){
-char variable1;
- variable1 = pc.getc();
- funcion2(variable1);
-}
+int variable;
+variable = funcion3();
+pc.printf("La variable retornada es %d \r\n", variable);
+
 }
 
 
-void funcion1()
-{ pc.printf("FUNCION SIN ARGUMENTO Y SIN RETORNO\r\n");  
-wait(1);
+int funcion3(void)
+{ int variable_de_funcion3 = 10;
+  return variable_de_funcion3;
 }
-
-void funcion2(char hola)
-{if(hola=='5')
-{
-    pc.printf("variable es %c", hola);
-    }
-else if(hola == '6')
-{
-    pc.printf("variable es %c", hola);  
-    }
-else{
-pc.printf("FUNCION CON ARGUMENTO Y SIN RETORNO\r\n");  
-   }
-   wait(1); }