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:2c225aab91ae
- Parent:
- 24:7f14b70fc9ef
- Child:
- 26:0abd50bf69ae
--- a/main.cpp Mon Apr 08 11:03:25 2019 +0100
+++ b/main.cpp Thu Apr 02 00:31:31 2020 +0000
@@ -1,12 +1,24 @@
-#include "mbed.h"
+#include "mbed.h" //libreria que nos permite utilizar comandos y ssentencias propias de mbed
+
+//programa que genera una función sin argumentos y sin retorno de valor
-DigitalOut myled(LED1);
+Serial com1(USBTX, USBRX);
+
+void mensaje(void); //declaración de función
+//El primer void representa ... el tipo de función, en este caso tenemos una función 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() {
- while(1) {
- myled = 1;
- wait(0.2);
- myled = 0;
- wait(0.2);
+int main()
+{
+ mensaje();
+
+}
+
+void mensaje (void)
+{ while(1)
+ {
+ com1.printf("Hola mundo \n");
+ wait(1);
}
-}
+