In case anyone else in the future needs to figure this out I was able to solve the original problem of controlling paddles for a pong game using a bluetooth serial module using the following code:
I included the following at the top of the program
#include <SoftwareSerial.h>
int incomingP1Byte = 0; // variable to store serial data
int paddle1Val = 0;
int paddle2Val = 0;
int flag = 0;
SoftwareSerial player1Serial(2, 3); // Initialize SoftwareSerial (RX, TX) for the bluetooth connections
Then accessed the paddles with the following code in void loop()
if(player1Serial.available() > 0)
{
incomingP1Byte = player1Serial.read();
Serial.print("I received: ");
Serial.println(incomingP1Byte);
// delay 10 milliseconds to allow serial update time
delay(10);
flag=0;
}
//check incoming byte for direction
if (incomingP1Byte == 49)
{
player1Serial.println(paddle1Val--);
delay(10);
}
else if (incomingP1Byte == 50)
{
player1Serial.println(paddle1Val++);
delay(10);
}
//-------------------------------right paddle
else if (incomingP1Byte == 51)
{
player1Serial.println(paddle2Val--);
delay(10);
}
else if (incomingP1Byte == 52)
{
player1Serial.println(paddle2Val++);
delay(10);
}