Need help getting RFID and potentiometer to communicate with Flash

Hello all,

I am currently working on a project where i use the RFID reader + tags to navigate through a database of media associated with each RFID tag. It was all going well until I tried customizing the Arduino code to be able to communicate with flash using both the RFID reader and a joystick (or a potentiometer). I was using the SYSEX through a serial communication to achieve that. Now since i have added the part where it reads the pot values (which was working great on its own) it has disabled Flash from receiving the values correctly… I’m not quite sure what to do to help me improve my code and make it work properly, I would really appreciate some help! Thanks

Here is my code:

#include <Firmata.h>
#include <SoftwareSerial.h>

/**
* Prallax RFID reader code for Arduino 
* Wiring version by BARRAGAN <http://people.interaction-ivrea.it/h.barragan>, modified for Arudino by djmatic
* Modified to use SoftwareSerial and Firmata by Erik Sjodin, eriksjodin.net
*
* Connect:
* Arduino Pin 3 to RFID SOUT
* Arduino GND to RFID GND
* Arduino Digital pin 2 to RFID /ENABLE
* Arduino 5v to RFID VCC
*/

int  val = 0; // temporary storage variable

// --- Reader One
char rfidOneTag[10];
char emptyArray[10];
int rfidOneBytesRead = 0; 
int rfidOneEnablePin = 2;
int rfidOneRxPin=3;
int rfidOneTxPin=12;

boolean bNewTagRead = false;

// pot
int pot1Pin = 0;    // select the input pin for the potentiometer
int pot1Value = 0;  // variable to store the value coming from the sensor

// set up a new serial port, we won't ever transmit anything to the reader but let's set the tx pin anyway
SoftwareSerial rfidOneSerial =  SoftwareSerial(rfidOneRxPin, rfidOneTxPin);

void setup() { 

  Serial.begin(19200);
  
  // --- Reader One
  pinMode(rfidOneRxPin, INPUT);
  pinMode(rfidOneTxPin, OUTPUT);
  rfidOneSerial.begin(2400);    // RFID reader SOUT pin connected to Serial RX pin at 2400bps
  
  // --- Reader One
  pinMode(rfidOneEnablePin,OUTPUT);     // set digital pin 2 as OUTPUT to connect it to the RFID /ENABLE pin 
  digitalWrite(rfidOneEnablePin, LOW);  // initialise the reader with a reset cycle
  delay(100);
  digitalWrite(rfidOneEnablePin, HIGH);
  delay(100);
  digitalWrite(rfidOneEnablePin, LOW);
  delay(100);
  
  for (int i=0; i<10; i++ ) emptyArray[i] = 5;
  for (int i=0; i<10; i++ ) rfidOneTag[i] = 33;
} 

void loop()
{ 

  // --- Reader One
  digitalWrite(rfidOneEnablePin, LOW);   // activate reader
 // pot1Value = int((float)analogRead( pot1Pin )/4.0f);
  val = rfidOneSerial.read();
  
  
  Serial.print(START_SYSEX,BYTE);
    if ( bNewTagRead )
    {
     Serial.print(rfidOneTag);
     bNewTagRead = false;
    }
    else
    {
      Serial.print(emptyArray);
    }
    
  Serial.print(END_SYSEX,BYTE);
  //  Serial.print ("pot1Value " + pot1Value);
  
  
  if(val == 10)
  {                        // check for header - start of new RFID tag
    rfidOneBytesRead = 0; 
  } 
  else if(val == 13) // end of RFID tag
  {                    
     // if header or stop bytes before the 10 digit reading 
     if(rfidOneBytesRead == 10)
     {
         // if 10 digit read is complete 
           // digitalWrite(rfidOneEnablePin, HIGH);      // deactivate the reader
            // transmit the tag as a SysEx message
            //Serial.print(START_SYSEX,BYTE);     
            //Serial.print(rfidOneTag);       
            //Serial.print(END_SYSEX,BYTE);         
            
            bNewTagRead = true;
     } 

     rfidOneBytesRead = 0;                          // stop collecting the tag 
  }
  else // read one of the 10 bytes of tag id
  {
    // rfidOneTag[rfidOneBytesRead] = val;            // add the digit 
     rfidOneBytesRead++;                            // ready to read next digit
  }  
  
  // read the value from the sensor:


  delay(250);
}

Why is some of your code commented out?