Trouble processing data from computer

Arduino D connect by USB (serial) to computer.

I am trying to format the data with an identifier character then the data in the following 5 characters. So to test I would be sending for example A55000.

I have 2 rem’d println statments that when unrem’d result in the program sending back to the monitor the expected end results, but when I rem those 2 out I get a gibberish answer.

Have I missed some concept here? … (I am very much a new to this)
Thank you for your assistance.

int identifier; // to determine what data object we are actually receiving
long RPMin[5]; //temp array to receive RPM data
long maxRPM[5]; //temp array to receive max RPM details

void setup() {
for (int i=2; i <= 13; i++){
pinMode(i, OUTPUT);

void loop () {
if(Serial.available()) {
// Identifiers
// A = RPM
// B = Maximum RPM of engine
identifier =; // A = ascii 65
// Serial.println(identifier); // <-------------- I get correct results when this in unrem’d
switch (identifier){
case 1 :
// A = RPM
for (int i=0;i<=4;i++){
RPMin =;
// Serial.println(RPMin*);// <-------------- I get correct results when this in unrem’d*
* }*
* // put final RPM value into long Variable*
_ long myRPM = RPMin[0]10000+RPMin[1]1000+RPMin[2]100+RPMin[3]10+RPMin[4] ;_
Serial.println(myRPM); // <----------------- This returns the wrong value to the monitor when above marked line are unrem’d
* }*
* }*

Here are some fragments that I hope will point you in the right direction.

#define IDENTIFIER ‘A’ // identifier does not need to be a variable

char RPMinText[5]; // → these will hold your input text from the serial port
char maxRPMText[5]; // → they should be an array of chars, not longs

long RPMin; // you will convert the text above to a long and store in these variables
long RPMax;

Then, in top of your loop you want syncronize by waiting until you get IDENTIFIER :

if( == IDENTIFIER ) {
//TODO: wait here until you have five charactors read into RPMinText
// Convert the 5 chars to a long stored as per your posted code

// do the same for RPMax

Serial.print(RPMin, DEC); // note that you need to call a print function that
// converts to a text representation of a decimal value
Serial.print(RPMax, DEC);
else ; // ignore everything until you get your identifier