Page 11 - Manual Técnico Proyecto_Float
P. 11

rgb.g = ((float)green / sum) * 255;

                 rgb.b = ((float)blue / sum) * 255;
                 rgb.toHSV(hsv);
                 Serial.print("H:\t"); Serial.print(hsv.h);
                 Serial.print("\tV:\t"); Serial.println(hsv.v);
                 if (hsv.v > 0.45) {
                   if (hsv.h > 180 && hsv.h < 197) { // evalúa rangos de color celeste
                     CambiarColorTodos(128, 128, 255);
                     CircuitPlayground.irSend.send(IR_PROTOCOL,IR_CELESTE,IR_BITS);
                     delay(ESPERA * 1000);

                   }
                   if (hsv.h > 132 && hsv.h < 145) {// evalúa rangos de color verde
                     CambiarColorTodos(0, 255, 0);
                     CircuitPlayground.irSend.send(IR_PROTOCOL,IR_VERDE,IR_BITS);
                     delay(ESPERA * 1000);
                   }
                   if (hsv.h > 330 && hsv.h < 342) evalúa rangos de color fucsia

                     CambiarColorTodos(204, 0, 204);
                     CircuitPlayground.irSend.send(IR_PROTOCOL,IR_FUCSIA,IR_BITS);
                     delay(ESPERA * 1000);
                   }
                   if (hsv.h > 355 && hsv.h < 360) {// evalúa rangos de color rojo
                     CambiarColorTodos(255, 0, 0);
                     CircuitPlayground.irSend.send(IR_PROTOCOL,IR_ROJO,IR_BITS);
                     delay(ESPERA * 1000);
                   }

                   if (hsv.h > 232 && hsv.h < 245) {// evalúa rangos de color morado
                     CambiarColorTodos(128, 0, 255);
                     CircuitPlayground.irSend.send(IR_PROTOCOL,IR_MORADO,IR_BITS);
                     delay(ESPERA * 1000);
                   }
                   if (hsv.h > 30 && hsv.h < 60) { // evalúa rangos de color amarillo
                     CambiarColorTodos(255, 255, 0);

                     CircuitPlayground.irSend.send(IR_PROTOCOL,IR_AMARILLO,IR_BITS);
                     delay(ESPERA * 1000);
                   }
                   if (hsv.h > 210 && hsv.h < 230) {// evalúa rangos de color azul
                     CambiarColorTodos(0, 0, 255);
                     CircuitPlayground.irSend.send(IR_PROTOCOL,IR_AZUL,IR_BITS);
                     delay(ESPERA * 1000);
   6   7   8   9   10   11   12   13   14   15   16