Ejercicio realizado por: HU, Julian y LOPEZ, Gabriel.

Dependencies:   mbed

Committer:
GabiLopez
Date:
Thu Jun 27 21:36:35 2019 +0000
Revision:
2:2aa02cd60b0b
Parent:
1:06553fdedc7e
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GabiLopez 0:ff8d1aea6fb4 1 #include "mbed.h"
GabiLopez 0:ff8d1aea6fb4 2
GabiLopez 2:2aa02cd60b0b 3 #define ON 0
GabiLopez 2:2aa02cd60b0b 4 #define OFF 1
GabiLopez 1:06553fdedc7e 5
GabiLopez 1:06553fdedc7e 6 #define LED_ON 0
GabiLopez 1:06553fdedc7e 7 #define LED_OFF 1
GabiLopez 2:2aa02cd60b0b 8 #define NADA 99
GabiLopez 2:2aa02cd60b0b 9 //------------------------------SALIDA DE LEDS--------------------------------//
GabiLopez 2:2aa02cd60b0b 10 DigitalOut led_r(LED_RED);
GabiLopez 2:2aa02cd60b0b 11 DigitalOut led_a(LED_BLUE);
GabiLopez 2:2aa02cd60b0b 12 DigitalOut led_v(LED_GREEN);
GabiLopez 2:2aa02cd60b0b 13 //---------------------------ENTRADA DE PULSADORES----------------------------//
GabiLopez 2:2aa02cd60b0b 14 DigitalIn boton_0 (PTC12);
GabiLopez 2:2aa02cd60b0b 15 DigitalIn boton_1 (PTC13);
GabiLopez 2:2aa02cd60b0b 16 DigitalIn boton_2 (PTC16);
GabiLopez 2:2aa02cd60b0b 17 //----------------------------MAQUINA PRINCIPAL-------------------------------//
GabiLopez 2:2aa02cd60b0b 18 enum {
GabiLopez 2:2aa02cd60b0b 19 INICIO,
GabiLopez 2:2aa02cd60b0b 20 SECUENCIA_LED,
GabiLopez 2:2aa02cd60b0b 21 MUESTRA_SECUENCIA,
GabiLopez 2:2aa02cd60b0b 22 DETECCION
GabiLopez 2:2aa02cd60b0b 23 } maq_principal;
GabiLopez 2:2aa02cd60b0b 24 //------------------------MAQUINA DE MUESTRA DE LEDS--------------------------//
GabiLopez 2:2aa02cd60b0b 25 enum {
GabiLopez 2:2aa02cd60b0b 26 MUESTRA_LED,
GabiLopez 2:2aa02cd60b0b 27 LED_R_ON,
GabiLopez 2:2aa02cd60b0b 28 LED_V_ON,
GabiLopez 2:2aa02cd60b0b 29 LED_A_ON
GabiLopez 2:2aa02cd60b0b 30 } maq_leds;
GabiLopez 2:2aa02cd60b0b 31 //---------------------MAQUINA DE DETTECION DE PULSADORES---------------------//
GabiLopez 2:2aa02cd60b0b 32 enum {
GabiLopez 2:2aa02cd60b0b 33 DETT_PULS,
GabiLopez 2:2aa02cd60b0b 34 BOTON_0_ON,
GabiLopez 2:2aa02cd60b0b 35 BOTON_1_ON,
GabiLopez 2:2aa02cd60b0b 36 BOTON_2_ON
GabiLopez 2:2aa02cd60b0b 37 } maq_botones;
GabiLopez 2:2aa02cd60b0b 38 //----------------MAQUINA DE DETECCION DE PULSADOR DE INICIO------------------//
GabiLopez 2:2aa02cd60b0b 39 enum {
GabiLopez 2:2aa02cd60b0b 40 DETT,
GabiLopez 2:2aa02cd60b0b 41 ESP
GabiLopez 2:2aa02cd60b0b 42 } encendido;
GabiLopez 2:2aa02cd60b0b 43 //-------------------------------FUNCIONES------------------------------------//
GabiLopez 2:2aa02cd60b0b 44 void pulsador_on();
GabiLopez 2:2aa02cd60b0b 45 void muestra_de_leds();
GabiLopez 2:2aa02cd60b0b 46 void deteccion_de_puls();
GabiLopez 2:2aa02cd60b0b 47 //---------------------------FUNCION PARA TIMER-------------------------------//
GabiLopez 2:2aa02cd60b0b 48 void timer();
GabiLopez 2:2aa02cd60b0b 49 Ticker ti;
GabiLopez 2:2aa02cd60b0b 50 int t_juego = 0;
GabiLopez 2:2aa02cd60b0b 51 bool toff = false;
GabiLopez 2:2aa02cd60b0b 52 bool errores = false;
GabiLopez 2:2aa02cd60b0b 53 bool a = false;
GabiLopez 0:ff8d1aea6fb4 54
GabiLopez 2:2aa02cd60b0b 55 uint8_t boton = NADA,random;
GabiLopez 2:2aa02cd60b0b 56 uint8_t turno = 0, turno_acciones = 0;
GabiLopez 2:2aa02cd60b0b 57 int t_led = 0, t_espera=0, t_juego = 0;// VARIABLES PARA TEMPORIZADORES
GabiLopez 2:2aa02cd60b0b 58 uint8_t secuencia[24];
GabiLopez 0:ff8d1aea6fb4 59
GabiLopez 0:ff8d1aea6fb4 60
GabiLopez 0:ff8d1aea6fb4 61 int main()
GabiLopez 0:ff8d1aea6fb4 62 {
GabiLopez 0:ff8d1aea6fb4 63 __enable_irq();
GabiLopez 2:2aa02cd60b0b 64 //-----------------------PULL UP PARA LOS PULSADORES--------------------------//
GabiLopez 2:2aa02cd60b0b 65 boton_0.mode(PullUp);
GabiLopez 2:2aa02cd60b0b 66 boton_1.mode(PullUp);
GabiLopez 2:2aa02cd60b0b 67 boton_2.mode(PullUp);
GabiLopez 2:2aa02cd60b0b 68 //----------------------------------------------------------------------------//
GabiLopez 2:2aa02cd60b0b 69 encendido = DETT;
GabiLopez 2:2aa02cd60b0b 70 maq_botones = DETT_PULS;
GabiLopez 2:2aa02cd60b0b 71 maq_principal = INICIO;
GabiLopez 2:2aa02cd60b0b 72 maq_leds = MUESTRA_LED;
GabiLopez 2:2aa02cd60b0b 73 srand(random);
GabiLopez 0:ff8d1aea6fb4 74
GabiLopez 2:2aa02cd60b0b 75 ti.attach(&timer,0.01);
GabiLopez 2:2aa02cd60b0b 76 /*
GabiLopez 2:2aa02cd60b0b 77 EL PROGRAMA EMPIEZA ESPERANDO LA SEÑAL DEL PULSADOR DE INICIO.
GabiLopez 2:2aa02cd60b0b 78 UNA VEZ PULSADO, EMPIEZA EL JUEGO, ENTRE CADA PULSO HAY 5 SEGUNDOS DE ESPERA
GabiLopez 2:2aa02cd60b0b 79 SI LLEGA A LOS 5 SEGUNDOS Y NO SE PRESIONO NINGUN BOTON, PIERDES Y EL JUEGO
GabiLopez 2:2aa02cd60b0b 80 SE REINICIA.
GabiLopez 2:2aa02cd60b0b 81 LA SECUENCIA SE VA A IR GENERANDO A MEDIDA QUE VA AVANZANDO EL JUEGO.
GabiLopez 2:2aa02cd60b0b 82 */
GabiLopez 2:2aa02cd60b0b 83 while(1) {
GabiLopez 2:2aa02cd60b0b 84 switch (maq_principal) {
GabiLopez 2:2aa02cd60b0b 85 case INICIO:
GabiLopez 2:2aa02cd60b0b 86 if (a == false) {
GabiLopez 2:2aa02cd60b0b 87 printf("toque el primer boton para comenzar\n");
GabiLopez 2:2aa02cd60b0b 88 a = true;
GabiLopez 2:2aa02cd60b0b 89 }
GabiLopez 2:2aa02cd60b0b 90 pulsador_on();
GabiLopez 2:2aa02cd60b0b 91 led_r = LED_ON;
GabiLopez 2:2aa02cd60b0b 92 led_a = LED_ON;
GabiLopez 2:2aa02cd60b0b 93 led_v = LED_ON;
GabiLopez 2:2aa02cd60b0b 94 if (boton == 5) {
GabiLopez 2:2aa02cd60b0b 95 boton = NADA;
GabiLopez 2:2aa02cd60b0b 96 turno = 0;
GabiLopez 2:2aa02cd60b0b 97 maq_principal = SECUENCIA_LED;
GabiLopez 2:2aa02cd60b0b 98 }
GabiLopez 2:2aa02cd60b0b 99 break;
GabiLopez 2:2aa02cd60b0b 100 case SECUENCIA_LED:
GabiLopez 2:2aa02cd60b0b 101 if (turno == 24) {
GabiLopez 2:2aa02cd60b0b 102 maq_principal = INICIO;
GabiLopez 2:2aa02cd60b0b 103 printf("you won \n");
GabiLopez 2:2aa02cd60b0b 104 }
GabiLopez 2:2aa02cd60b0b 105 if (turno < 24) {
GabiLopez 2:2aa02cd60b0b 106 secuencia[turno] = rand () % 3;
GabiLopez 2:2aa02cd60b0b 107 t_led = 50;
GabiLopez 2:2aa02cd60b0b 108 maq_principal = MUESTRA_SECUENCIA;
GabiLopez 2:2aa02cd60b0b 109 }
GabiLopez 2:2aa02cd60b0b 110 break;
GabiLopez 2:2aa02cd60b0b 111 case MUESTRA_SECUENCIA:
GabiLopez 2:2aa02cd60b0b 112 muestra_de_leds();
GabiLopez 2:2aa02cd60b0b 113 if (t_led == 0 && turno_acciones > turno) {
GabiLopez 2:2aa02cd60b0b 114 turno_acciones = 0;
GabiLopez 2:2aa02cd60b0b 115 t_juego = 500;
GabiLopez 2:2aa02cd60b0b 116 maq_principal = DETECCION;
GabiLopez 2:2aa02cd60b0b 117 }
GabiLopez 2:2aa02cd60b0b 118 break;
GabiLopez 2:2aa02cd60b0b 119 case DETECCION:
GabiLopez 2:2aa02cd60b0b 120 deteccion_de_puls();
GabiLopez 2:2aa02cd60b0b 121 if (errores == true) {
GabiLopez 2:2aa02cd60b0b 122 printf("you lose\n");
GabiLopez 2:2aa02cd60b0b 123 maq_principal = INICIO;
GabiLopez 2:2aa02cd60b0b 124 }
GabiLopez 2:2aa02cd60b0b 125 if (t_juego == 0) {
GabiLopez 2:2aa02cd60b0b 126 printf("se acabo el tiempo\n");
GabiLopez 2:2aa02cd60b0b 127 maq_principal = INICIO;
GabiLopez 2:2aa02cd60b0b 128 }
GabiLopez 2:2aa02cd60b0b 129 if (turno_acciones > turno) {
GabiLopez 2:2aa02cd60b0b 130 turno_acciones = 0;
GabiLopez 2:2aa02cd60b0b 131 turno++;
GabiLopez 2:2aa02cd60b0b 132 maq_principal = SECUENCIA_LED;
GabiLopez 2:2aa02cd60b0b 133 }
GabiLopez 0:ff8d1aea6fb4 134 }
GabiLopez 0:ff8d1aea6fb4 135 }
GabiLopez 1:06553fdedc7e 136 }
GabiLopez 2:2aa02cd60b0b 137
GabiLopez 2:2aa02cd60b0b 138 void pulsador_on()
GabiLopez 1:06553fdedc7e 139 {
GabiLopez 2:2aa02cd60b0b 140 switch(encendido) {
GabiLopez 2:2aa02cd60b0b 141 case DETT:
GabiLopez 2:2aa02cd60b0b 142 if (boton_0 == ON && t_espera == 0) {
GabiLopez 2:2aa02cd60b0b 143 t_espera = 5;
GabiLopez 2:2aa02cd60b0b 144 toff = false;
GabiLopez 2:2aa02cd60b0b 145 encendido = ESP;
GabiLopez 2:2aa02cd60b0b 146 }
GabiLopez 2:2aa02cd60b0b 147 break;
GabiLopez 2:2aa02cd60b0b 148 case ESP:
GabiLopez 2:2aa02cd60b0b 149 if (t_espera == 0 && toff == false && boton_0 == OFF) {
GabiLopez 2:2aa02cd60b0b 150 t_espera = 5;
GabiLopez 2:2aa02cd60b0b 151 toff = true;
GabiLopez 2:2aa02cd60b0b 152 }
GabiLopez 2:2aa02cd60b0b 153 if(t_espera == 0 && toff == true) {
GabiLopez 2:2aa02cd60b0b 154 boton = 5;
GabiLopez 2:2aa02cd60b0b 155 encendido = DETT;
GabiLopez 2:2aa02cd60b0b 156 }
GabiLopez 2:2aa02cd60b0b 157 break;
GabiLopez 1:06553fdedc7e 158 }
GabiLopez 2:2aa02cd60b0b 159 }
GabiLopez 2:2aa02cd60b0b 160 /*
GabiLopez 2:2aa02cd60b0b 161 SE VAN MOSTRANDO LA SECUENCIA DE LOS LED, SE VA A MOSTRAR POR 1 SEGUNDO Y
GabiLopez 2:2aa02cd60b0b 162 VA A ESTAR APAGADO POR 0.5 SEGUNDOS, DE ESTA FORMA SE LO PUEDE DIFERENCIAR
GabiLopez 2:2aa02cd60b0b 163 DE OTRA SECUENCIA CON EL MISMO COLOR.
GabiLopez 2:2aa02cd60b0b 164 */
GabiLopez 2:2aa02cd60b0b 165 void muestra_de_leds()
GabiLopez 2:2aa02cd60b0b 166 {
GabiLopez 2:2aa02cd60b0b 167 switch (maq_leds) {
GabiLopez 2:2aa02cd60b0b 168 case MUESTRA_LED:
GabiLopez 2:2aa02cd60b0b 169 led_r = LED_OFF;
GabiLopez 2:2aa02cd60b0b 170 led_a = LED_OFF;
GabiLopez 2:2aa02cd60b0b 171 led_v = LED_OFF;
GabiLopez 2:2aa02cd60b0b 172 if (t_led == 0 && turno_acciones <= turno) {
GabiLopez 2:2aa02cd60b0b 173 if(secuencia[turno_acciones] == 0) {
GabiLopez 2:2aa02cd60b0b 174 maq_leds = LED_R_ON;
GabiLopez 2:2aa02cd60b0b 175 t_led = 100;
GabiLopez 2:2aa02cd60b0b 176 }
GabiLopez 2:2aa02cd60b0b 177 if(secuencia[turno_acciones] == 1) {
GabiLopez 2:2aa02cd60b0b 178 maq_leds = LED_V_ON;
GabiLopez 2:2aa02cd60b0b 179 t_led = 100;
GabiLopez 2:2aa02cd60b0b 180 }
GabiLopez 2:2aa02cd60b0b 181 if(secuencia[turno_acciones] == 2) {
GabiLopez 2:2aa02cd60b0b 182 maq_leds = LED_A_ON;
GabiLopez 2:2aa02cd60b0b 183 t_led = 100;
GabiLopez 2:2aa02cd60b0b 184 }
GabiLopez 2:2aa02cd60b0b 185 }
GabiLopez 2:2aa02cd60b0b 186 break;
GabiLopez 2:2aa02cd60b0b 187 case LED_R_ON:
GabiLopez 2:2aa02cd60b0b 188 led_r = LED_ON;
GabiLopez 2:2aa02cd60b0b 189 led_a = LED_OFF;
GabiLopez 2:2aa02cd60b0b 190 led_v = LED_OFF;
GabiLopez 2:2aa02cd60b0b 191 if (t_led == 0) {
GabiLopez 2:2aa02cd60b0b 192 turno_acciones++;
GabiLopez 2:2aa02cd60b0b 193 t_led = 50;
GabiLopez 2:2aa02cd60b0b 194 maq_leds = MUESTRA_LED;
GabiLopez 2:2aa02cd60b0b 195 }
GabiLopez 2:2aa02cd60b0b 196 break;
GabiLopez 2:2aa02cd60b0b 197 case LED_V_ON:
GabiLopez 2:2aa02cd60b0b 198 led_r = LED_OFF;
GabiLopez 2:2aa02cd60b0b 199 led_a = LED_OFF;
GabiLopez 2:2aa02cd60b0b 200 led_v = LED_ON;
GabiLopez 2:2aa02cd60b0b 201 if (t_led == 0) {
GabiLopez 2:2aa02cd60b0b 202 turno_acciones++;
GabiLopez 2:2aa02cd60b0b 203 t_led = 50;
GabiLopez 2:2aa02cd60b0b 204 maq_leds = MUESTRA_LED;
GabiLopez 2:2aa02cd60b0b 205 }
GabiLopez 2:2aa02cd60b0b 206 break;
GabiLopez 2:2aa02cd60b0b 207 case LED_A_ON:
GabiLopez 2:2aa02cd60b0b 208 led_r = LED_OFF;
GabiLopez 2:2aa02cd60b0b 209 led_a = LED_ON;
GabiLopez 2:2aa02cd60b0b 210 led_v = LED_OFF;
GabiLopez 2:2aa02cd60b0b 211 if (t_led == 0) {
GabiLopez 2:2aa02cd60b0b 212 turno_acciones++;
GabiLopez 2:2aa02cd60b0b 213 t_led = 50;
GabiLopez 2:2aa02cd60b0b 214 maq_leds = MUESTRA_LED;
GabiLopez 2:2aa02cd60b0b 215 }
GabiLopez 2:2aa02cd60b0b 216 break;
GabiLopez 0:ff8d1aea6fb4 217 }
GabiLopez 0:ff8d1aea6fb4 218 }
GabiLopez 2:2aa02cd60b0b 219 /*
GabiLopez 2:2aa02cd60b0b 220 LOS BOTONES ESTAN PROGRAMADOS PARA QUE SE ACTIVEN CON FLANCO DESCENDENTE,
GabiLopez 2:2aa02cd60b0b 221 ENTONCES SI LOS PRESIONAN, PRIMERO VA A CONTAR 50MS DE ANTIREBOTE Y ESPERA
GabiLopez 2:2aa02cd60b0b 222 A QUE SUELTEN EL BOTON, UNA VEZ SOLTADO EL BOTON, VA A ESPERAR OTROS 50MS
GabiLopez 2:2aa02cd60b0b 223 DE ANTIRREBOTE Y ES ESE PUNTO DETECTA EL BOTON.
GabiLopez 2:2aa02cd60b0b 224 */
GabiLopez 2:2aa02cd60b0b 225 void deteccion_de_puls()
GabiLopez 0:ff8d1aea6fb4 226 {
GabiLopez 2:2aa02cd60b0b 227 switch(maq_botones) {
GabiLopez 2:2aa02cd60b0b 228 case DETT_PULS:
GabiLopez 2:2aa02cd60b0b 229 led_r = LED_OFF;
GabiLopez 2:2aa02cd60b0b 230 led_a = LED_OFF;
GabiLopez 2:2aa02cd60b0b 231 led_v = LED_OFF;
GabiLopez 2:2aa02cd60b0b 232 if (t_juego > 0 && turno_acciones <= turno && errores == false) {
GabiLopez 2:2aa02cd60b0b 233 if (boton_0 == ON && t_espera == 0) {
GabiLopez 2:2aa02cd60b0b 234 t_espera = 5;
GabiLopez 2:2aa02cd60b0b 235 toff = false;
GabiLopez 2:2aa02cd60b0b 236 led_r = LED_ON;
GabiLopez 2:2aa02cd60b0b 237 maq_botones = BOTON_0_ON;
GabiLopez 2:2aa02cd60b0b 238 }
GabiLopez 2:2aa02cd60b0b 239 if (boton_1 == ON && t_espera == 0) {
GabiLopez 2:2aa02cd60b0b 240 t_espera = 5;
GabiLopez 2:2aa02cd60b0b 241 toff = false;
GabiLopez 2:2aa02cd60b0b 242 led_v = LED_ON;
GabiLopez 2:2aa02cd60b0b 243 maq_botones = BOTON_1_ON;
GabiLopez 2:2aa02cd60b0b 244 }
GabiLopez 2:2aa02cd60b0b 245 if (boton_2 == ON && t_espera == 0) {
GabiLopez 2:2aa02cd60b0b 246 t_espera = 5;
GabiLopez 2:2aa02cd60b0b 247 toff = false;
GabiLopez 2:2aa02cd60b0b 248 led_a = LED_ON;
GabiLopez 2:2aa02cd60b0b 249 maq_botones = BOTON_2_ON;
GabiLopez 2:2aa02cd60b0b 250 }
GabiLopez 2:2aa02cd60b0b 251 }
GabiLopez 2:2aa02cd60b0b 252 break;
GabiLopez 2:2aa02cd60b0b 253 case BOTON_0_ON:
GabiLopez 2:2aa02cd60b0b 254 if (t_espera == 0 && toff == false && boton_0 == OFF) {
GabiLopez 2:2aa02cd60b0b 255 t_espera = 5;
GabiLopez 2:2aa02cd60b0b 256 toff = true;
GabiLopez 2:2aa02cd60b0b 257 }
GabiLopez 2:2aa02cd60b0b 258 if (t_espera == 0 && toff == true) {
GabiLopez 2:2aa02cd60b0b 259 boton = 0;
GabiLopez 2:2aa02cd60b0b 260 if (boton == secuencia[turno_acciones]) {
GabiLopez 2:2aa02cd60b0b 261 turno_acciones++;
GabiLopez 2:2aa02cd60b0b 262 t_juego = 500;
GabiLopez 2:2aa02cd60b0b 263 } else {
GabiLopez 2:2aa02cd60b0b 264 errores = true;
GabiLopez 2:2aa02cd60b0b 265 }
GabiLopez 2:2aa02cd60b0b 266 maq_botones = DETT_PULS;
GabiLopez 2:2aa02cd60b0b 267 boton = NADA;
GabiLopez 2:2aa02cd60b0b 268 }
GabiLopez 2:2aa02cd60b0b 269 break;
GabiLopez 2:2aa02cd60b0b 270 case BOTON_1_ON:
GabiLopez 2:2aa02cd60b0b 271 if (t_espera == 0 && toff == false && boton_1 == OFF) {
GabiLopez 2:2aa02cd60b0b 272 t_espera = 5;
GabiLopez 2:2aa02cd60b0b 273 toff = true;
GabiLopez 2:2aa02cd60b0b 274 }
GabiLopez 2:2aa02cd60b0b 275 if (t_espera == 0 && toff == true) {
GabiLopez 2:2aa02cd60b0b 276 boton = 1;
GabiLopez 2:2aa02cd60b0b 277 if (boton == secuencia[turno_acciones]) {
GabiLopez 2:2aa02cd60b0b 278 turno_acciones++;
GabiLopez 2:2aa02cd60b0b 279 t_juego = 500;
GabiLopez 2:2aa02cd60b0b 280 } else {
GabiLopez 2:2aa02cd60b0b 281 errores = true;
GabiLopez 2:2aa02cd60b0b 282 }
GabiLopez 2:2aa02cd60b0b 283 maq_botones = DETT_PULS;
GabiLopez 2:2aa02cd60b0b 284 boton = NADA;
GabiLopez 2:2aa02cd60b0b 285 }
GabiLopez 2:2aa02cd60b0b 286 break;
GabiLopez 2:2aa02cd60b0b 287 case BOTON_2_ON:
GabiLopez 2:2aa02cd60b0b 288 if (t_espera == 0 && toff == false && boton_2 == OFF) {
GabiLopez 2:2aa02cd60b0b 289 t_espera = 5;
GabiLopez 2:2aa02cd60b0b 290 toff = true;
GabiLopez 2:2aa02cd60b0b 291 }
GabiLopez 2:2aa02cd60b0b 292 if (t_espera == 0 && toff == true) {
GabiLopez 2:2aa02cd60b0b 293 boton = 2;
GabiLopez 2:2aa02cd60b0b 294 if (boton == secuencia[turno_acciones]) {
GabiLopez 2:2aa02cd60b0b 295 turno_acciones++;
GabiLopez 2:2aa02cd60b0b 296 t_juego = 500;
GabiLopez 2:2aa02cd60b0b 297 } else {
GabiLopez 2:2aa02cd60b0b 298 errores = true;
GabiLopez 2:2aa02cd60b0b 299 }
GabiLopez 2:2aa02cd60b0b 300 maq_botones = DETT_PULS;
GabiLopez 2:2aa02cd60b0b 301 boton = NADA;
GabiLopez 2:2aa02cd60b0b 302 }
GabiLopez 2:2aa02cd60b0b 303 break;
GabiLopez 0:ff8d1aea6fb4 304 }
GabiLopez 0:ff8d1aea6fb4 305 }
GabiLopez 2:2aa02cd60b0b 306 void timer ()
GabiLopez 1:06553fdedc7e 307 {
GabiLopez 2:2aa02cd60b0b 308 if(t_led > 0)
GabiLopez 2:2aa02cd60b0b 309 t_led--;
GabiLopez 2:2aa02cd60b0b 310 if(t_espera > 0)
GabiLopez 2:2aa02cd60b0b 311 t_espera--;
GabiLopez 2:2aa02cd60b0b 312 if(t_juego > 0)
GabiLopez 2:2aa02cd60b0b 313 t_juego--;
GabiLopez 1:06553fdedc7e 314 }