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.
Dependencies: mbed
Revision 3:7d496863c448, committed 2019-09-13
- Comitter:
- ArturoRiosRamos
- Date:
- Fri Sep 13 19:38:07 2019 +0000
- Parent:
- 1:b5216422f915
- Commit message:
- Portada
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r b5216422f915 -r 7d496863c448 main.cpp
--- a/main.cpp Fri Sep 13 15:45:52 2019 +0000
+++ b/main.cpp Fri Sep 13 19:38:07 2019 +0000
@@ -1,6 +1,6 @@
/* ###########################################################################
** Archivo : main.c
-** Proyecto : STM32-103C8_Adivina
+** Proyecto : STM32-103C8_Portada
** Procesador : STM32F103C8
** Herramienta : Mbed
** Version : Driver 01.01
@@ -15,14 +15,15 @@
** Autores :
** ATEAM Development Group:
** - Antulio Morgado Valle
+ Rios Ramos Arturo
**
** Versión : Beta
** Revisión : A
** Release : 0
** Bugs & Fixes :
-** Date : 20/10/2019
-** Ejemplpo del Hola Mundo
-** 27/09/2010
+** Date : 13/09/2019
+** Portada datos generales
+**
**
**
** ###########################################################################*/
@@ -74,6 +75,7 @@
| Definición de Funciones Prototipo y Rutinas de los Vectores de Interrupción
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
+void Portada();
void Setup(void);
/* END definitions */
@@ -88,69 +90,20 @@
{ // Inicialización de variables, puertos e interrupciones
confSysClock(); // Configure system clock (72MHz HSE clock, 48MHz USB clock)
Setup(); // Inicialización del sistema
- terminal.printf ("ADIVINA\n\r");
- rojo = off;
- verde = off;
-
- while(TRUE)
- {
-Inicio: terminal.printf(" DIGITE UN NUMERO SECRETO DE 0 A 9 \r\n");
- secreto = terminal.getc();
- rojo = on;
- verde = on;
- do{
- Intenta: terminal.printf(" ADIVINA EL NUMERO: \r\n");
- respuesta = terminal.getc();
- if( secreto < respuesta )
- {
- terminal.printf(" Es mas Bajo \r\n");
- rojo = on;
- verde = off;
- goto Intenta;
- }
- if( secreto > respuesta )
- {
- terminal.printf(" Es mas Alto \r\n");
- rojo = off;
- verde = on;
- goto Intenta;
- }
- } while ( secreto != respuesta );
- intentos ++;
- if( secreto == respuesta )
- {
- terminal.printf(" CORRECTO!, Es igual a: %i \r\n",secreto);
- rojo = off;
- verde = on;
- wait(1.0);
- rojo = off;
- verde = off;
- wait(1.0);
- rojo = off;
- verde = on;
- wait(1.0);
- terminal.printf(" Eres un Genio !!! \r\n");
- wait(1.0);
- rojo = on;
- verde = off;
- wait(1.0);
- rojo = off;
- verde = on;
- terminal.printf(" El numero de intentos fue de: %d", intentos);
- }
- terminal.printf(" Quieres intentarlo de nuevo? \r\n");
- terminal.printf(" 0 = No \r\n 1 = Si \r\n");
- int opcion = terminal.getc();
- if( opcion == '1' ) goto Inicio;
- else if( opcion == '0' )
- {
- terminal.printf(" Eso es todo Amigos! \r\n");
- break;
- }
- }
+Portada();
+
+
}
+void Portada()
+{
+ terminal.printf("\tESCUELA SUPERIOR DE INGENIERIA MECANICA Y ELECTRICA\n");
+ terminal.printf("\t Ingenieria en comunicaciones y electronica\n\n");
+ terminal.printf("\t\t\tAnalisis numerico\n\n");
+ terminal.printf("\t\t\tPrograma N. \n\n");
+ terminal.printf("\tArturo Rios Ramos \t\t\t4CV2\n\n");
+}
/* END main */
/*
@@ -180,26 +133,7 @@
/* END documentation */
/*
-+--------------------------------------------------------------------------------
-| EJERCICIO
-|
-| 1.- Este programa tambien acepta letras o caracteres?
-| 2.- Modificar este programa para:
-| a) Que solo acepte números
-| b) Agregar un contador de Número de Intentos
-|
-+--------------------------------------------------------------------------------
-|
-| EXAMEN
-|
-| 1.- Modificar el programa para que despliegue el número de intentos para
-| adivinar el número secreto.
-| 2.- Modificar el programa para haga eco con la respuesta que le introducimos.
-|
-| 3.- Modificar el programa para que el número secreto sea generado aleatoriamente.
-| a) Generar un Número Pseudo Aleatorio Mediante el Ticker
-| b) Utilizando la función RANDOMIZE
-| Suerte!
+
+--------------------------------------------------------------------------------
|
| T H E A N T U L I U S T E A M