Paso 13: Viento y lluvia cálculos
void myMode() / / calcula la dirección del viento de modo (el valor que ocurre más a menudo).
{
Si (windDirection2 == 1) {uno = uno + 1;}
Si (windDirection2 == 2) {dos = dos + 1;}
Si (windDirection2 == 3) {tres = tres + 1;}
Si (windDirection2 == 4) {cuatro = cuatro + 1;}
Si (windDirection2 == 5) {cinco = cinco + 1;}
Si (windDirection2 == 6) {seis = 6 + 1;}
Si (windDirection2 == 7) {7 = siete + 1;}
Si (windDirection2 == 8) {ocho = 8 + 1;}
Si ((un > dos) & &(one>three) & &(one>four) & &(one>five) & &(one>six) & &(one>seven) & &(one>eight) & &(one>answerB)) {answerB =; answerA = 1;}
Si ((dos > uno) & &(two>three) & &(two>four) & &(two>five) & &(two>six) & &(two>seven) & &(two>eight) & &(two>answerB)) {answerB =; answerA = 2;}
Si ((tres > uno) & &(three>two) & &(three>four) & &(three>five) & &(three>six) & &(three>seven) & &(three>eight) & &(three>answerB)) {answerB = tres; answerA = 3;}
Si ((cuatro > uno) & &(four>two) & &(four>three) & &(four>five) & &(four>six) & &(four>seven) & &(four>eight) & &(four>answerB)) {answerB = cuatro; answerA = 4;}
Si ((cinco > uno) & &(five>two) & &(five>three) & &(five>four) & &(five>six) & &(five>seven) & &(five>eight) & &(five>answerB)) {answerB = cinco; answerA = 5;}
Si ((seis > uno) & &(six>two) & &(six>three) & &(six>four) & &(six>five) & &(six>seven) & &(six>eight) & &(six>answerB)) {answerB = seis; answerA = 6;}
Si ((siete > uno) & &(seven>two) & &(seven>three) & &(seven>four) & &(seven>five) & &(seven>six) & &(seven>eight) & &(seven>answerB)) {answerB = siete; answerA = 7;}
Si ((ocho > uno) & &(eight>two) & &(eight>three) & &(eight>four) & &(eight>five) & &(eight>six) & &(eight>seven) & &(eight>answerB)) {answerB = ocho; answerA = 8;}
Serial.Print ("mi modo valor es:"); Serial.println(answerA);
}