ARDUINO MEGA 2560 ARDUINO MEGA 2560 J.L.G.C | Page 63

pinMode (AD1, OUTPUT);

pinMode (BD2, OUTPUT);

pinMode (CD3, OUTPUT);

pinMode (DE4, OUTPUT);

pinMode (ED5, OUTPUT);

pinMode (FD6, OUTPUT);

pinMode (GD7, OUTPUT);

pinMode(2, 0); //Pushbuttons for players. Pin 2 is for player two. Pin 3 is for player one.

pinMode(3, 0);

}

void loop()

{

ListenForInput();

currentMillis = millis();

if (currentMillis - previousMillis >= millisecondsPerLED)

{

CheckGoalConditions();

///////////////////////////////////////////////////////////

switch(scoreOfPlayerTwo)

{

case 0: //COMO ES DISPLAY DE ANODO COMUN TENEMOS QUE ENVIAR UN O LOGICO PARA QUE ENCIENDAN LOS SEGMENTOS

digitalWrite(A,LOW);

digitalWrite(B,LOW);

digitalWrite(C,LOW);

digitalWrite(D,LOW);

digitalWrite(E,LOW);

digitalWrite(F,LOW);

digitalWrite(G,HIGH);

break;

case 1:

digitalWrite(A,HIGH);

digitalWrite(B,LOW);

digitalWrite(C,LOW);

digitalWrite(D,HIGH);

digitalWrite(E,HIGH);

digitalWrite(F,HIGH);

digitalWrite(G,HIGH);

break;

case 2:

digitalWrite(A,LOW);

digitalWrite(B,LOW);

digitalWrite(C,HIGH);

digitalWrite(D,LOW);

digitalWrite(E,LOW);

digitalWrite(F,HIGH);

digitalWrite(G,LOW);

break;

case 3:

digitalWrite(A,LOW);

digitalWrite(B,LOW);

digitalWrite(C,LOW);

digitalWrite(D,LOW);

digitalWrite(E,HIGH);

digitalWrite(F,HIGH);

digitalWrite(G,LOW);

break;

case 4:

digitalWrite(A,HIGH);

digitalWrite(B,LOW);

digitalWrite(C,LOW);

digitalWrite(D,HIGH);

digitalWrite(E,HIGH);

digitalWrite(F,LOW);

digitalWrite(G,LOW);

break;

case 5:

digitalWrite(A,LOW);

digitalWrite(B,HIGH);

digitalWrite(C,LOW);

digitalWrite(D,LOW);

digitalWrite(E,HIGH);

digitalWrite(F,LOW);

digitalWrite(G,LOW);

break;

case 6:

digitalWrite(A,LOW);

digitalWrite(B,HIGH);

digitalWrite(C,LOW);

digitalWrite(D,LOW);

digitalWrite(E,LOW);

digitalWrite(F,LOW);

digitalWrite(G,LOW);

break;

60