Page 16 - Manual Técnico Proyecto_Float
P. 16
void CambiarColorTodos(int r, int g, int b) {
for (int i = 0; i <= 9; i++) {
CircuitPlayground.setPixelColor(i, r, g, b);
delay(25);
}
delay(250);
CircuitPlayground.clearPixels();
}
void Reproduce(int libro, int picto) { // prepara y reproduce sonido asociado al pictograma seleccionado
String fna = F("L0AUD0 OGG");
fna.setCharAt(1, '0' + libro);
fna.setCharAt(5, '0' + picto);
if (tiempoAud[libro - 1][picto - 1] > 0 && !sfx.playTrack((char*)fna.c_str()) ) {
Serial.print("Error al reproducir: ");
Serial.println(fna);
} else {
if (tiempoAud[libro - 1][picto - 1] > 0) {
delay(tiempoAud[libro - 1][picto - 1] * 1000L);
sfx.reset();
delay(500);
}
}
String fnv = F("L0VOZ0 OGG"); // prepara y reproduce voz asociada al pictograma seleccionado
fnv.setCharAt(1, '0' + libro);
fnv.setCharAt(5, '0' + picto);
if ( tiempoVoz[libro - 1][picto - 1] > 0 && !sfx.playTrack((char*)fnv.c_str()) ) {
Serial.print("Error al reproducir: ");
Serial.println(fnv);
} else {
if (tiempoAud[libro - 1][picto - 1] > 0) {
delay(tiempoVoz[libro - 1][picto - 1] * 1000L);
sfx.reset();
delay(500);
}
}
}
void AlumbraPicto(int pic, int r, int g, int b) {
pictoN = picto[pic - 1];
red = r;
green = g;