Practica 7

Dependencies:   mbed

Revision:
26:29f649949409
Parent:
25:90e7333db6a7
Child:
27:eb32f100130f
--- a/main.cpp	Tue Oct 01 18:17:17 2019 +0000
+++ b/main.cpp	Fri Oct 04 16:19:52 2019 +0000
@@ -1,12 +1,36 @@
 #include "mbed.h"
+Serial pc(USBTX,USBRX);
+
+
+void funcion1(void); //Funcion sin argumento y sin regreso de dato 
+void funcion2(char);//Funcion con argumento y sin retorno
 
-DigitalOut foquito2(LED_BLUE);
+ int main()
+{
+    funcion1();
+    while (1){
+char variable1;
+ variable1 = pc.getc();
+ funcion2(variable1);
+}
+}
+
 
-int main() {
-    while(1) {
-        foquito2 = 1;
-        wait(5);
-        foquito2 = 0;
-        wait(5);
+void funcion1()
+{ pc.printf("FUNCION SIN ARGUMENTO Y SIN RETORNO\r\n");  
+wait(1);
+}
+
+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); }