Javier Marcelo
/
STM32F103C8_Minimos
Programa de Minimos.
main.cpp@7:ec4c4e249c82, 2019-10-25 (annotated)
- Committer:
- JavierMarcelo98
- Date:
- Fri Oct 25 15:29:08 2019 +0000
- Revision:
- 7:ec4c4e249c82
- Parent:
- 6:57457ad17880
Programa de Minimos.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Antulius | 0:f680c41c1640 | 1 | /* ########################################################################### |
Antulius | 0:f680c41c1640 | 2 | ** Archivo : main.c |
JavierMarcelo98 | 7:ec4c4e249c82 | 3 | ** Proyecto : STM32-103C8_Minimos |
Antulius | 0:f680c41c1640 | 4 | ** Procesador : STM32F103C8 |
Antulius | 0:f680c41c1640 | 5 | ** Herramienta : Mbed |
Antulius | 0:f680c41c1640 | 6 | ** Version : Driver 01.01 |
Antulius | 0:f680c41c1640 | 7 | ** Compilador : GNU C Compiler |
Antulius | 0:f680c41c1640 | 8 | ** Fecha/Hora : 14-07-2015, 11:48, # CodeGen: 0 |
Antulius | 0:f680c41c1640 | 9 | ** Descripción : |
Antulius | 0:f680c41c1640 | 10 | ** Este proyecto muestra la configuración y uso de la Terminal Serial |
Antulius | 0:f680c41c1640 | 11 | ** This module contains user's application code. |
Antulius | 0:f680c41c1640 | 12 | ** Componentes : Timer, etc . |
Antulius | 0:f680c41c1640 | 13 | ** Configuraciones : Se puede seleccionar entre diferentes velocodades de |
Antulius | 0:f680c41c1640 | 14 | ** transmisión |
Antulius | 0:f680c41c1640 | 15 | ** Autores : |
Antulius | 0:f680c41c1640 | 16 | ** ATEAM Development Group: |
Antulius | 0:f680c41c1640 | 17 | ** - Antulio Morgado Valle |
JavierMarcelo98 | 4:e8498d695fc2 | 18 | ** - Marcelo Padron Javier |
Antulius | 0:f680c41c1640 | 19 | ** |
Antulius | 0:f680c41c1640 | 20 | ** Versión : Beta |
Antulius | 0:f680c41c1640 | 21 | ** Revisión : A |
Antulius | 0:f680c41c1640 | 22 | ** Release : 0 |
Antulius | 0:f680c41c1640 | 23 | ** Bugs & Fixes : |
JavierMarcelo98 | 4:e8498d695fc2 | 24 | ** Date : 22/10/2019 |
JavierMarcelo98 | 4:e8498d695fc2 | 25 | ** |
ArturoRiosRamos | 3:7d496863c448 | 26 | ** |
Antulius | 0:f680c41c1640 | 27 | ** |
Antulius | 0:f680c41c1640 | 28 | ** |
Antulius | 0:f680c41c1640 | 29 | ** ###########################################################################*/ |
Antulius | 0:f680c41c1640 | 30 | /* |
Antulius | 0:f680c41c1640 | 31 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
Antulius | 0:f680c41c1640 | 32 | : Includes |
Antulius | 0:f680c41c1640 | 33 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
Antulius | 0:f680c41c1640 | 34 | */ |
Antulius | 0:f680c41c1640 | 35 | |
Antulius | 0:f680c41c1640 | 36 | #include "stm32f103c8t6.h" |
Antulius | 0:f680c41c1640 | 37 | #include "mbed.h" |
Antulius | 0:f680c41c1640 | 38 | #include "Serial.h" |
Antulius | 0:f680c41c1640 | 39 | #include "stdio.h" |
Antulius | 0:f680c41c1640 | 40 | /* |
Antulius | 0:f680c41c1640 | 41 | :............................................................................... |
Antulius | 0:f680c41c1640 | 42 | : Definiciones |
Antulius | 0:f680c41c1640 | 43 | :............................................................................... |
Antulius | 0:f680c41c1640 | 44 | */ |
Antulius | 0:f680c41c1640 | 45 | #define on 0 // Estado para boton presionado |
Antulius | 0:f680c41c1640 | 46 | #define off 1 // Estado para boton sin presionar |
Antulius | 0:f680c41c1640 | 47 | #define hold 2 // Estado para boton mantenido |
Antulius | 0:f680c41c1640 | 48 | #define release 3 // Estado para boton liberado |
Antulius | 0:f680c41c1640 | 49 | #define FALSE 0 // Estado FALSO |
Antulius | 0:f680c41c1640 | 50 | #define TRUE 1 // Estado VERDADERO |
JavierMarcelo98 | 4:e8498d695fc2 | 51 | #define Ticker_Rate 1000 // Tiempo del Ticker |
JavierMarcelo98 | 4:e8498d695fc2 | 52 | ////////////////////////////////////////// Definimos las notas notas musicales y su frecuencia. |
Antulius | 0:f680c41c1640 | 53 | /* |
Antulius | 0:f680c41c1640 | 54 | +------------------------------------------------------------------------------- |
Antulius | 0:f680c41c1640 | 55 | | Configuración de Puertos |
Antulius | 0:f680c41c1640 | 56 | +------------------------------------------------------------------------------- |
JavierMarcelo98 | 4:e8498d695fc2 | 57 | */ |
JavierMarcelo98 | 5:7bd28f4ca12b | 58 | DigitalOut verde (LED1); // NC (Green_Led) |
JavierMarcelo98 | 4:e8498d695fc2 | 59 | DigitalOut Led_Monitor (PB_1); // Led monitor de la Tarjeta STM32F103C8 |
JavierMarcelo98 | 4:e8498d695fc2 | 60 | Serial terminal (PA_2, PA_3); // Inicializa la comunicación serial a la PC (Tx,Rx) |
JavierMarcelo98 | 4:e8498d695fc2 | 61 | //Serial terminal(USBTX, USBRX,115200);// Tx, Rx Baud Rate - Terminal Serial por USB @ 115,200 Bauds |
Antulius | 0:f680c41c1640 | 62 | |
Antulius | 0:f680c41c1640 | 63 | /* |
Antulius | 0:f680c41c1640 | 64 | +------------------------------------------------------------------------------- |
JavierMarcelo98 | 4:e8498d695fc2 | 65 | | Variables Globales de Usuario |
JavierMarcelo98 | 4:e8498d695fc2 | 66 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Antulius | 0:f680c41c1640 | 67 | */ |
Antulius | 0:f680c41c1640 | 68 | /* |
Antulius | 0:f680c41c1640 | 69 | | Definición de Funciones Prototipo y Rutinas de los Vectores de Interrupción |
Antulius | 0:f680c41c1640 | 70 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Antulius | 0:f680c41c1640 | 71 | */ |
ArturoRiosRamos | 3:7d496863c448 | 72 | void Portada(); |
JavierMarcelo98 | 7:ec4c4e249c82 | 73 | void Principal(); |
Antulius | 0:f680c41c1640 | 74 | void Setup(void); |
Antulius | 0:f680c41c1640 | 75 | /* END definitions */ |
Antulius | 0:f680c41c1640 | 76 | |
Antulius | 0:f680c41c1640 | 77 | /* |
Antulius | 0:f680c41c1640 | 78 | #=============================================================================== |
Antulius | 0:f680c41c1640 | 79 | | |
Antulius | 0:f680c41c1640 | 80 | | P R O G R A M A P R I N C I P A L |
Antulius | 0:f680c41c1640 | 81 | | |
Antulius | 0:f680c41c1640 | 82 | #=============================================================================== |
Antulius | 0:f680c41c1640 | 83 | */ |
Antulius | 0:f680c41c1640 | 84 | int main() |
JavierMarcelo98 | 6:57457ad17880 | 85 | { |
JavierMarcelo98 | 6:57457ad17880 | 86 | |
Antulius | 0:f680c41c1640 | 87 | Setup(); // Inicialización del sistema |
JavierMarcelo98 | 6:57457ad17880 | 88 | Portada(); |
JavierMarcelo98 | 7:ec4c4e249c82 | 89 | Principal(); |
ArturoRiosRamos | 3:7d496863c448 | 90 | } |
Antulius | 0:f680c41c1640 | 91 | /* END main */ |
Antulius | 0:f680c41c1640 | 92 | |
Antulius | 0:f680c41c1640 | 93 | /* |
Antulius | 0:f680c41c1640 | 94 | ................................................................................ |
Antulius | 0:f680c41c1640 | 95 | : Rutinas de los Vectores de Interrupción |
Antulius | 0:f680c41c1640 | 96 | ................................................................................ |
Antulius | 0:f680c41c1640 | 97 | */ |
Antulius | 0:f680c41c1640 | 98 | |
Antulius | 0:f680c41c1640 | 99 | /* END Events */ |
Antulius | 0:f680c41c1640 | 100 | /* |
Antulius | 0:f680c41c1640 | 101 | ________________________________________________________________________________ |
Antulius | 0:f680c41c1640 | 102 | | |
Antulius | 0:f680c41c1640 | 103 | | Funciones Prototipo |
Antulius | 0:f680c41c1640 | 104 | |_______________________________________________________________________________ |
Antulius | 0:f680c41c1640 | 105 | */ |
Antulius | 0:f680c41c1640 | 106 | // Las Funciones Prototipo van aquí ! |
Antulius | 0:f680c41c1640 | 107 | void Setup() |
Antulius | 0:f680c41c1640 | 108 | { |
Antulius | 0:f680c41c1640 | 109 | // terminal.baud(Baud_Rate); // Se configura la velocidad de transmisión e inicia la comunicación serial. |
JavierMarcelo98 | 4:e8498d695fc2 | 110 | terminal.baud(115200); // Se configura la velocidad de transmisión e inicia la comunicación serial. |
JavierMarcelo98 | 5:7bd28f4ca12b | 111 | } |
JavierMarcelo98 | 5:7bd28f4ca12b | 112 | void Portada()//Funcion Portada |
JavierMarcelo98 | 4:e8498d695fc2 | 113 | { |
JavierMarcelo98 | 5:7bd28f4ca12b | 114 | terminal.printf("\n\r\t\e[1;32m0101 0101 010101 01 10 0101 0101 0101 0101 0101 0101 0101 01 10 0101 0101\e[0m"); |
JavierMarcelo98 | 5:7bd28f4ca12b | 115 | terminal.printf("\n\r\t\e[1;32m01 01 01 010 010 01 0 0 1 01 0 1 10 01 010 10 01 0 1\e[0m"); |
JavierMarcelo98 | 5:7bd28f4ca12b | 116 | terminal.printf("\n\r\t\e[1;32m0101 0101 01 01 1 10 0101 1 0101 01 0101 10 0101 01 1 10 01 0 1\e[0m"); |
JavierMarcelo98 | 5:7bd28f4ca12b | 117 | terminal.printf("\n\r\t\e[1;32m01 01 01 01 10 01 0 0 1 01 0 1 10 01 01 010 01 0 1\e[0m"); |
JavierMarcelo98 | 5:7bd28f4ca12b | 118 | terminal.printf("\n\r\t\e[1;32m0101 0101 010101 01 10 0101 0101 0 1 0101 0 1 10 0101 01 10 0101 0101\e[0m"); |
JavierMarcelo98 | 5:7bd28f4ca12b | 119 | terminal.printf("\n\n\r\t\e[1;32m \'NUESTROS COLORES VERDE \e[0m\e[1;37mY BLANCO, POR QUE EL\e[0m\e[1;31m ROJO LO LLEVAMOS EN LA SANGRE!!!\'\e[0m\n\n"); |
JavierMarcelo98 | 5:7bd28f4ca12b | 120 | terminal.printf("\n\r\t\t\e[1;37m ESCUELA SUPERIOR DE INGENIERIA MECANICA Y ELECTRICA\e[0m"); |
JavierMarcelo98 | 5:7bd28f4ca12b | 121 | terminal.printf("\n\n\r\t\t\e[1;37m INGENIERIA EN COMUNICACIONES Y ELECTRONICA\e[0m"); |
JavierMarcelo98 | 5:7bd28f4ca12b | 122 | terminal.printf("\n\n\r\t\t\e[1;37m ANALISIS NUMERICO\e[0m"); |
JavierMarcelo98 | 7:ec4c4e249c82 | 123 | terminal.printf("\n\n\r\t\t\e[1;37m PROGRAMA: MINIMOS\e[0m"); |
JavierMarcelo98 | 5:7bd28f4ca12b | 124 | terminal.printf("\n\n\r\t\t\e[1;37m ALUMNO: MARCELO PADRON JAVIER\e[0m"); |
JavierMarcelo98 | 5:7bd28f4ca12b | 125 | terminal.printf("\n\n\r\t\t\e[1;37m GRUPO: 4CV2\e[0m\n\n"); |
JavierMarcelo98 | 5:7bd28f4ca12b | 126 | wait(3.0);//Retardo de 3 segundos |
JavierMarcelo98 | 4:e8498d695fc2 | 127 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 128 | void Principal() |
JavierMarcelo98 | 4:e8498d695fc2 | 129 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 130 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 131 | float aux[10],aux1[10],auxx[10],resultado[10],suma,sumat[10],tole[10], |
JavierMarcelo98 | 7:ec4c4e249c82 | 132 | tole1,tolefin[10],tolerancia,w,x1[10],xy[10][10]; |
JavierMarcelo98 | 7:ec4c4e249c82 | 133 | int grado,h,i,j; |
JavierMarcelo98 | 6:57457ad17880 | 134 | |
JavierMarcelo98 | 7:ec4c4e249c82 | 135 | terminal.printf("\nCual es el grado de la ecuaci¢n (2 ¢ 3): \n"); |
JavierMarcelo98 | 7:ec4c4e249c82 | 136 | grado=terminal.getc(); |
JavierMarcelo98 | 7:ec4c4e249c82 | 137 | for(j=0;j<10;j++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 138 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 139 | auxx[j]=0; |
JavierMarcelo98 | 7:ec4c4e249c82 | 140 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 141 | for(i=0;i<grado;i++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 142 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 143 | terminal.printf("\nIngresa la Ecuaci¢n Numero %d \n",i+1); |
JavierMarcelo98 | 7:ec4c4e249c82 | 144 | for(j=0;j<grado;j++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 145 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 146 | terminal.printf("\nX%d%d= ",i+1,j+1); |
JavierMarcelo98 | 7:ec4c4e249c82 | 147 | xy[i][j]=terminal.getc(); |
JavierMarcelo98 | 7:ec4c4e249c82 | 148 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 149 | terminal.printf("\nY%d= ",i+1); |
JavierMarcelo98 | 7:ec4c4e249c82 | 150 | resultado[i]=terminal.getc(); |
JavierMarcelo98 | 7:ec4c4e249c82 | 151 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 152 | terminal.printf("\nLas ecuaciones que ingresaste son:\n"); |
JavierMarcelo98 | 7:ec4c4e249c82 | 153 | for(i=0;i<grado;i++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 154 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 155 | for(j=0;j<grado;j++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 156 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 157 | terminal.printf(" %.0f[X%d]",xy[i][j],j+1); |
JavierMarcelo98 | 7:ec4c4e249c82 | 158 | if(j==0) |
JavierMarcelo98 | 7:ec4c4e249c82 | 159 | printf("+"); |
JavierMarcelo98 | 7:ec4c4e249c82 | 160 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 161 | terminal.printf("=",i+1); |
JavierMarcelo98 | 7:ec4c4e249c82 | 162 | terminal.printf("%.0f",resultado[i]); |
JavierMarcelo98 | 7:ec4c4e249c82 | 163 | terminal.printf("\n"); |
JavierMarcelo98 | 7:ec4c4e249c82 | 164 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 165 | terminal.printf("\n Matriz a resolver:\n"); |
JavierMarcelo98 | 7:ec4c4e249c82 | 166 | for(i=0;i<grado;i++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 167 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 168 | terminal.printf("\n%c ",179); |
JavierMarcelo98 | 7:ec4c4e249c82 | 169 | for(j=0;j<grado;j++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 170 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 171 | terminal.printf(" %.0f ",xy[i][j],j+1); |
JavierMarcelo98 | 7:ec4c4e249c82 | 172 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 173 | terminal.printf(" %c",179); |
JavierMarcelo98 | 7:ec4c4e249c82 | 174 | terminal.printf(" %.0f ",resultado[i]); |
JavierMarcelo98 | 7:ec4c4e249c82 | 175 | terminal.printf(" %c",179); |
JavierMarcelo98 | 7:ec4c4e249c82 | 176 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 177 | terminal.printf("\nIngresa la Exactitud o Tolerancia: "); |
JavierMarcelo98 | 7:ec4c4e249c82 | 178 | tolerancia=terminal.getc(); |
JavierMarcelo98 | 7:ec4c4e249c82 | 179 | for(;;) |
JavierMarcelo98 | 7:ec4c4e249c82 | 180 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 181 | h=0; |
JavierMarcelo98 | 7:ec4c4e249c82 | 182 | do |
JavierMarcelo98 | 7:ec4c4e249c82 | 183 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 184 | suma=0; |
JavierMarcelo98 | 7:ec4c4e249c82 | 185 | for(i=h;i<h+1;i++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 186 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 187 | for(j=0;j<grado;j++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 188 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 189 | if(j!=i) |
JavierMarcelo98 | 7:ec4c4e249c82 | 190 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 191 | suma+=((xy[i][j]*x1[j])/xy[i][i]); |
JavierMarcelo98 | 7:ec4c4e249c82 | 192 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 193 | |
JavierMarcelo98 | 7:ec4c4e249c82 | 194 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 195 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 196 | sumat[h]=suma; |
JavierMarcelo98 | 7:ec4c4e249c82 | 197 | h++; |
JavierMarcelo98 | 7:ec4c4e249c82 | 198 | }while(h<grado); |
JavierMarcelo98 | 7:ec4c4e249c82 | 199 | for(i=0,j=grado-1;i<grado;i++,j--) |
JavierMarcelo98 | 7:ec4c4e249c82 | 200 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 201 | aux[i]=auxx[j]; |
JavierMarcelo98 | 7:ec4c4e249c82 | 202 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 203 | for(i=0;i<grado;i++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 204 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 205 | for(j=0;j<grado;j++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 206 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 207 | if(i!=j) |
JavierMarcelo98 | 7:ec4c4e249c82 | 208 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 209 | auxx[i]=((resultado[i])/xy[i][i])-(sumat[i]); |
JavierMarcelo98 | 7:ec4c4e249c82 | 210 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 211 | else{ |
JavierMarcelo98 | 7:ec4c4e249c82 | 212 | terminal.printf("INDETEMINA"); |
JavierMarcelo98 | 6:57457ad17880 | 213 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 214 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 215 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 216 | for(i=0,j=grado-1;i<grado;i++,j--) { x1[i]=auxx[i]; } |
JavierMarcelo98 | 7:ec4c4e249c82 | 217 | for(i=0;i<grado;i++) { tole[i]=0; } |
JavierMarcelo98 | 7:ec4c4e249c82 | 218 | for(i=0,j=grado-1;i<grado;i++,j--) { aux1[i]=auxx[j]; } |
JavierMarcelo98 | 7:ec4c4e249c82 | 219 | for(i=0;i<grado;i++) { tole[i]=aux1[i]-aux[i]; } |
JavierMarcelo98 | 7:ec4c4e249c82 | 220 | |
JavierMarcelo98 | 7:ec4c4e249c82 | 221 | int k=0; |
JavierMarcelo98 | 7:ec4c4e249c82 | 222 | while(k<grado) |
JavierMarcelo98 | 7:ec4c4e249c82 | 223 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 224 | for(i=0;i<grado-1;i++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 225 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 226 | if(tole[i]<tole[i+1]) |
JavierMarcelo98 | 7:ec4c4e249c82 | 227 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 228 | tole1=tole[i];tole[i]=tole[i+1];tole[i+1]=tole1; |
JavierMarcelo98 | 7:ec4c4e249c82 | 229 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 230 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 231 | k++; |
JavierMarcelo98 | 7:ec4c4e249c82 | 232 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 233 | for( j=0;j<grado;j++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 234 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 235 | tolefin[j]=tole[j]; |
JavierMarcelo98 | 7:ec4c4e249c82 | 236 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 237 | w=tolefin[0]; |
JavierMarcelo98 | 7:ec4c4e249c82 | 238 | terminal.printf("\n"); |
JavierMarcelo98 | 7:ec4c4e249c82 | 239 | for(j=0;j<grado;j++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 240 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 241 | terminal.printf("x%d= %f\n",j+1,auxx[j]); |
JavierMarcelo98 | 7:ec4c4e249c82 | 242 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 243 | if(fabs(w)<=tolerancia) |
JavierMarcelo98 | 7:ec4c4e249c82 | 244 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 245 | terminal.printf("\nResultados en la Iteracion Numero %d \n"); |
JavierMarcelo98 | 7:ec4c4e249c82 | 246 | for(j=0;j<grado;j++) |
JavierMarcelo98 | 7:ec4c4e249c82 | 247 | { |
JavierMarcelo98 | 7:ec4c4e249c82 | 248 | terminal.printf("X%d=%.15f\n",j+1,auxx[j]); |
JavierMarcelo98 | 7:ec4c4e249c82 | 249 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 250 | terminal.getc(); |
JavierMarcelo98 | 7:ec4c4e249c82 | 251 | break; |
JavierMarcelo98 | 7:ec4c4e249c82 | 252 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 253 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 254 | } |
JavierMarcelo98 | 7:ec4c4e249c82 | 255 | } |
Antulius | 0:f680c41c1640 | 256 | /* END routines */ |
Antulius | 0:f680c41c1640 | 257 | |
Antulius | 0:f680c41c1640 | 258 | /* END program */ |
Antulius | 0:f680c41c1640 | 259 | |
Antulius | 0:f680c41c1640 | 260 | /* END documentation */ |
Antulius | 0:f680c41c1640 | 261 | /* |
ArturoRiosRamos | 3:7d496863c448 | 262 | |
Antulius | 0:f680c41c1640 | 263 | +-------------------------------------------------------------------------------- |
Antulius | 0:f680c41c1640 | 264 | | |
Antulius | 0:f680c41c1640 | 265 | | T H E A N T U L I U S T E A M |
Antulius | 0:f680c41c1640 | 266 | | Research, Development, Systems Equipment, Support & Spare Parts I n c. |
Antulius | 0:f680c41c1640 | 267 | | (C) Copyright 1989-2014, All rigths Reserved |
Antulius | 0:f680c41c1640 | 268 | | |
Antulius | 0:f680c41c1640 | 269 | | This program is licensed under rules of |
Antulius | 0:f680c41c1640 | 270 | | THE BEANERS TECHNOLOGIES PROYECT |
Antulius | 0:f680c41c1640 | 271 | +------------------------------------------------------------------------------- |
Antulius | 0:f680c41c1640 | 272 | */ |
JavierMarcelo98 | 7:ec4c4e249c82 | 273 | /* END Mbed */ |