Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 26:29f649949409
- Parent:
- 25:90e7333db6a7
- Child:
- 27:eb32f100130f
diff -r 90e7333db6a7 -r 29f649949409 main.cpp
--- 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); }