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:
- 25:c4eed8baa6d3
- Parent:
- 24:7f14b70fc9ef
diff -r 7f14b70fc9ef -r c4eed8baa6d3 main.cpp
--- a/main.cpp Mon Apr 08 11:03:25 2019 +0100
+++ b/main.cpp Thu Apr 02 00:31:09 2020 +0000
@@ -1,12 +1,24 @@
-#include "mbed.h"
+#include "mbed.h" //libreria que nos permite utilizar comandos y sentencias propias de mbed
-DigitalOut myled(LED1);
+//programa que genera una función sin argumentos y sin retorno de valor
-int main() {
- while(1) {
- myled = 1;
- wait(0.2);
- myled = 0;
- wait(0.2);
- }
-}
+Serial com1(USBTX, USBRX);
+
+ void mensaje(void); //declaración de funcion
+ //El primer void representa ... el tipo de funcion, en este caso tenemos una funcion void por lo tanto no esperamos un retorno de valor
+ //El segundo void representa ... el tipo de variable, en este caso tenemos variables void por lo tanto no debemos ingresar valor
+
+
+ int main()
+ {
+ mensaje();
+
+ }
+
+void mensaje(void)
+{ while(1)
+ {
+ com1.printf("Hola mundo \n");
+ wait(1);
+ }
+}
\ No newline at end of file