int pot = A0; //player1 input int potState; int potState2; int pot2 = A1; //player2 input int pot2State; int pot2State2; int resetButton = 2; //reset button int resetButtonState; void setup() { Serial.begin(9600); pinMode(pot, INPUT); pinMode(pot2, INPUT); pinMode(resetButton, INPUT); potState = analogRead(pot); pot2State = analogRead(pot2); } void loop() { potState2 = analogRead(pot); if(potState2 < potState - 15 || potState2 > potState + 15){ //checks how much value has changed, if not siginficant, does not output //this keeps paddle from moving constantly Serial.print("Player1: "); Serial.print(potState2); Serial.println(" "); potState = potState2; } pot2State2 = analogRead(pot2); if(pot2State2 < pot2State - 20 || pot2State2 > pot2State + 20){ Serial.print("Player2: "); Serial.print(pot2State2); Serial.println(" "); pot2State = pot2State2; } resetButtonState = digitalRead(resetButton); //prints number nt used otherwise to indicate button has been pressed if(resetButtonState == HIGH){ Serial.println(5000); while(resetButtonState == HIGH){ //stays in loop while button is held to prevent indicating //that the button has been pressed multiple times resetButtonState = digitalRead(resetButton); } } }