Printing Character Array

Hi There,
I am using a number of photo transistor (sensors) and reading the output via Digital Read. I need to get the data into a array and output it later via Serial Print. However, the output does not display any of the values on the string. (if I print each sensor value directly, it prints as expected.)

declaration

char Layer1ShortSideData[10];

in Loop

for(int i =0; i< 9; i++)
{SelectInput(Layer3ShortSide[i]);
  Layer1ShortSideData[i]=char(digitalRead(ChipB));}

Layer1ShortSideData[9]=0; //Terminating String

Serial.println(Layer1ShortSideData);

Moderator edit: It's a really good habit to get into posting ALL code between code tags.

I'm posting the complete code below. Thanks in advance

int PinSelect0 =2; // Digital Pins for Selection of Chips via MUX
int PinSelect1 =3;
int PinSelect2 =4;
int PinSelect3 =5;

int ChipA =6; // Output from Chips 1-6
int ChipB =7;
int ChipC =8; 
int ChipD =9;
int ChipE =10;
int ChipF =11;


//int SensorValue;
long Layer3Data;
//Mapping of Multiplextor Chip Pins in Order of Sensors (Outside to Inside(connector end) order in Layer)
int Layer3ShortSide[9]={4,12,3,15,2,14,1,13,0};// Moving away from Connector End in Sensor Plate) 
int Layer3LongSide[16]= {0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8}; // Moving away from Connector End of Sensor Plate
// Sensor1 of 17 is value 11 -  special read from chipB
int ReadDelay = 1;
int OutDelay = 1;

char Layer1ShortSideData[10];
char Layer2ShortSideData[10];
char Layer3ShortSideData[10];
char Layer1LongSideData[18];
char Layer2LongSideData[18];
char Layer3LongSideData[18];

int tank[17][9];

void setup(){
  //Initialize control pins
  pinMode(PinSelect0, OUTPUT); 
  pinMode(PinSelect1, OUTPUT); 
  pinMode(PinSelect2, OUTPUT); 
  pinMode(PinSelect3, OUTPUT);
  pinMode(ChipA, INPUT); 
  pinMode(ChipB, INPUT); 
  pinMode(ChipC, INPUT); 
  pinMode(ChipD, INPUT);
  pinMode(ChipE, INPUT);
  pinMode(ChipF, INPUT);
 
  Serial.begin(115200);
}

void loop()

{
  
  //SHORT SIDE
  for(int i =0; i< 9; i++){
  SelectInput(Layer3ShortSide[i]);
  Layer1ShortSideData[i]=char(digitalRead(ChipB));
  Layer2ShortSideData[i]=char(digitalRead(ChipD));
  Layer3ShortSideData[i]=char(digitalRead(ChipF));}
  
  //**************LONG SIDE
  for(int i =0; i< 16; i++){
  SelectInput(Layer3LongSide[i]);
  Layer1LongSideData[i] = char(digitalRead(ChipA));
  Layer2LongSideData[i] = char(digitalRead(ChipC));
  Layer3LongSideData[i] = char(digitalRead(ChipE));}
  
  SelectInput(11);  //Read Sensor1(B11)
  delay(ReadDelay);
  Layer1LongSideData[16] = digitalRead(ChipB);
  Layer2LongSideData[16] = digitalRead(ChipD);
  Layer3LongSideData[16] = digitalRead(ChipF);
  delay(OutDelay);
  //************
  
  Layer1ShortSideData[17]=0;
  Layer2ShortSideData[17]=0;
  Layer3ShortSideData[17]=0;
  Layer1LongSideData[9]=0;
  Layer2LongSideData[9]=0;
  Layer3LongSideData[9]=0;
  
  Serial.println(Layer1LongSideData);
  Serial.println(Layer2LongSideData);
  Serial.println(Layer3LongSideData);
  Serial.println(Layer1ShortSideData);
  Serial.println(Layer2ShortSideData);
  Serial.println(Layer3ShortSideData);
  
  delay(1000);
  
for(int i=0; i<17; i++){
for(int j=0; j<9; j++){
   if (Layer1ShortSideData[j]== '0') {
  if (Layer1LongSideData[i]== '0') {
    tank[i][j]=+1;}
  else {tank[i][j]=+0;}}
   if (Layer2ShortSideData[j]== '0') {
  if (Layer2LongSideData[i]== '0') {
    tank[i][j]=+2;}
  else {tank[i][j]=+0;}}
   if (Layer3ShortSideData[j]== '0') {
  if (Layer3LongSideData[i]== '0') {
    tank[i][j]=+4;}
  else {tank[i][j]=+0;}}
  }
}

for(int i=0; i<9; i++){
for(int j=0; j<17; j++){
   Serial.print(tank[i][j]);
   Serial.print(" ");}
   Serial.println("");}
   
}//end main loop

int SelectInput(int Input){
switch (Input) {
    case 0: {
       digitalWrite(PinSelect0, LOW);
       digitalWrite(PinSelect1, LOW);
       digitalWrite(PinSelect2, LOW);
       digitalWrite(PinSelect3, LOW);
       break;}
    case 1: {
       digitalWrite(PinSelect0, HIGH);
       digitalWrite(PinSelect1, LOW);
       digitalWrite(PinSelect2, LOW);
       digitalWrite(PinSelect3, LOW);
       break;}
    case 2: {
       digitalWrite(PinSelect0, LOW);
       digitalWrite(PinSelect1, HIGH);
       digitalWrite(PinSelect2, LOW);
       digitalWrite(PinSelect3, LOW);
       break;}
   case 3: {
       digitalWrite(PinSelect0, HIGH);
       digitalWrite(PinSelect1, HIGH);
       digitalWrite(PinSelect2, LOW);
       digitalWrite(PinSelect3, LOW);
       break;}
    case 4: {
       digitalWrite(PinSelect0, LOW);
       digitalWrite(PinSelect1, LOW);
       digitalWrite(PinSelect2, HIGH);
       digitalWrite(PinSelect3, LOW);
       break;}
    case 5: {
       digitalWrite(PinSelect0, HIGH);
       digitalWrite(PinSelect1, LOW);
       digitalWrite(PinSelect2, HIGH);
       digitalWrite(PinSelect3, LOW);
       break;}
    case 6: {
       digitalWrite(PinSelect0, LOW);
       digitalWrite(PinSelect1, HIGH);
       digitalWrite(PinSelect2, HIGH);
       digitalWrite(PinSelect3, LOW);
       break;}
    case 7: {
       digitalWrite(PinSelect0, HIGH);
       digitalWrite(PinSelect1, HIGH);
       digitalWrite(PinSelect2, HIGH);
       digitalWrite(PinSelect3, LOW);
       break;}
    case 8: {
       digitalWrite(PinSelect0, LOW);
       digitalWrite(PinSelect1, LOW);
       digitalWrite(PinSelect2, LOW);
       digitalWrite(PinSelect3, HIGH);
       break;}
   case 9: {
       digitalWrite(PinSelect0, HIGH);
       digitalWrite(PinSelect1, LOW);
       digitalWrite(PinSelect2, LOW);
       digitalWrite(PinSelect3, HIGH);
       break;}
    case 10: {
       digitalWrite(PinSelect0, LOW);
       digitalWrite(PinSelect1, HIGH);
       digitalWrite(PinSelect2, LOW);
       digitalWrite(PinSelect3, HIGH);
       break;}
    case 11: {
       digitalWrite(PinSelect0, HIGH);
       digitalWrite(PinSelect1, HIGH);
       digitalWrite(PinSelect2, LOW);
       digitalWrite(PinSelect3, HIGH);
       break;}
    case 12: {
       digitalWrite(PinSelect0, LOW);
       digitalWrite(PinSelect1, LOW);
       digitalWrite(PinSelect2, HIGH);
       digitalWrite(PinSelect3, HIGH);
       break;}
    case 13: {
       digitalWrite(PinSelect0, HIGH);
       digitalWrite(PinSelect1, LOW);
       digitalWrite(PinSelect2, HIGH);
       digitalWrite(PinSelect3, HIGH);
       break;}
    case 14: {
       digitalWrite(PinSelect0, LOW);
       digitalWrite(PinSelect1, HIGH);
       digitalWrite(PinSelect2, HIGH);
       digitalWrite(PinSelect3, HIGH);
       break;}
   case 15: {
       digitalWrite(PinSelect0, HIGH);
       digitalWrite(PinSelect1, HIGH);
       digitalWrite(PinSelect2, HIGH);
       digitalWrite(PinSelect3, HIGH);
       break;}
       }
delay(ReadDelay);
}
tank[i][j]=+1;}
  else {tank[i][j]=+0;}}

Why?
Is that what you intended?

Thank you AWOL for the prompt reply.

Actually the sensors are on two sides of a tank (Two matrixes). I am trying to detect the depth and position of an object in it. (The Tank (i,j0 corrsponds to a position when one looks from above). The value corresponds to the depth. However, in my code, even before getting to that stage, I cant seem to display the string, or it is not properly assigned.

Using the IDE's auto-format tool before posting code is strongly recommended.
Your indentation makes following the code difficult.

I regret my ignorance...Here it is.

int PinSelect0 =2; // Digital Pins for Selection of Chips via MUX
int PinSelect1 =3;
int PinSelect2 =4;
int PinSelect3 =5;

int ChipA =6; // Output from Chips 1-6
int ChipB =7;
int ChipC =8; 
int ChipD =9;
int ChipE =10;
int ChipF =11;


//int SensorValue;
long Layer3Data;
//Mapping of Multiplextor Chip Pins in Order of Sensors (Outside to Inside(connector end) order in Layer)
//Original Order for Short Side, as from Connector end to Opposite is {4,12,3,15,2,14,1,13,0}
int Layer3ShortSide[9]={
  4,12,3,15,2,14,1,13,0};// Moving away from Connector End in Sensor Plate) 
//int Layer3ShortSide[9]={0,13,1,14,2,15,3,12,4}; // Moving to Connector End of Sensor Plate
int Layer3LongSide[16]= {
  0,15,1,14,2,13,3,12,4,11,5,10,6,9,7,8}; // Moving away from Connector End of Sensor Plate
//int Layer3LongSide[16]= {8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,0}; //Moving to Connector End of Sensor Plate 
// Sensor1 of 17 is value 11 -  special read from chipB
int ReadDelay = 1;
int OutDelay = 1;

char Layer1ShortSideData[10];
char Layer2ShortSideData[10];
char Layer3ShortSideData[10];
char Layer1LongSideData[18];
char Layer2LongSideData[18];
char Layer3LongSideData[18];

int tank[17][9];

void setup(){
  //Initialize control pins
  pinMode(PinSelect0, OUTPUT); 
  pinMode(PinSelect1, OUTPUT); 
  pinMode(PinSelect2, OUTPUT); 
  pinMode(PinSelect3, OUTPUT);
  pinMode(ChipA, INPUT); 
  pinMode(ChipB, INPUT); 
  pinMode(ChipC, INPUT); 
  pinMode(ChipD, INPUT);
  pinMode(ChipE, INPUT);
  pinMode(ChipF, INPUT);

  Serial.begin(115200);
}

void loop()

{

  //SHORT SIDE
  for(int i =0; i< 9; i++){
    SelectInput(Layer3ShortSide[i]);
    Layer1ShortSideData[i]=char(digitalRead(ChipB));
    Layer2ShortSideData[i]=char(digitalRead(ChipD));
    Layer3ShortSideData[i]=char(digitalRead(ChipF));
  }

  //**************LONG SIDE
  for(int i =0; i< 16; i++){
    SelectInput(Layer3LongSide[i]);
    Layer1LongSideData[i] = char(digitalRead(ChipA));
    Layer2LongSideData[i] = char(digitalRead(ChipC));
    Layer3LongSideData[i] = char(digitalRead(ChipE));
  }

  SelectInput(11);  //Read Sensor1(B11)
  delay(ReadDelay);
  Layer1LongSideData[16] = digitalRead(ChipB);
  Layer2LongSideData[16] = digitalRead(ChipD);
  Layer3LongSideData[16] = digitalRead(ChipF);
  delay(OutDelay);
  //************

  Layer1ShortSideData[9]=0;
  Layer2ShortSideData[9]=0;
  Layer3ShortSideData[9]=0;
  Layer1LongSideData[17]=0;
  Layer2LongSideData[17]=0;
  Layer3LongSideData[17]=0;

  Serial.println(Layer1LongSideData);
  Serial.println(Layer2LongSideData);
  Serial.println(Layer3LongSideData);
  Serial.println(Layer1ShortSideData);
  Serial.println(Layer2ShortSideData);
  Serial.println(Layer3ShortSideData);

  delay(1000);

  for(int i=0; i<17; i++){
    for(int j=0; j<9; j++){
      if (Layer1ShortSideData[j]== '0') {
        if (Layer1LongSideData[i]== '0') {
          tank[i][j]=+1;
        }
        else {
          tank[i][j]=+0;
        }
      }
      if (Layer2ShortSideData[j]== '0') {
        if (Layer2LongSideData[i]== '0') {
          tank[i][j]=+2;
        }
        else {
          tank[i][j]=+0;
        }
      }
      if (Layer3ShortSideData[j]== '0') {
        if (Layer3LongSideData[i]== '0') {
          tank[i][j]=+4;
        }
        else {
          tank[i][j]=+0;
        }
      }
    }
  }

  for(int i=0; i<9; i++){
    for(int j=0; j<17; j++){
      Serial.print(tank[i][j]);
      Serial.print(" ");
    }
    Serial.println("");
  }

}//end main loop

int SelectInput(int Input){
  switch (Input) {
  case 0: 
    {
      digitalWrite(PinSelect0, LOW);
      digitalWrite(PinSelect1, LOW);
      digitalWrite(PinSelect2, LOW);
      digitalWrite(PinSelect3, LOW);
      break;
    }
  case 1: 
    {
      digitalWrite(PinSelect0, HIGH);
      digitalWrite(PinSelect1, LOW);
      digitalWrite(PinSelect2, LOW);
      digitalWrite(PinSelect3, LOW);
      break;
    }
  case 2: 
    {
      digitalWrite(PinSelect0, LOW);
      digitalWrite(PinSelect1, HIGH);
      digitalWrite(PinSelect2, LOW);
      digitalWrite(PinSelect3, LOW);
      break;
    }
  case 3: 
    {
      digitalWrite(PinSelect0, HIGH);
      digitalWrite(PinSelect1, HIGH);
      digitalWrite(PinSelect2, LOW);
      digitalWrite(PinSelect3, LOW);
      break;
    }
  case 4: 
    {
      digitalWrite(PinSelect0, LOW);
      digitalWrite(PinSelect1, LOW);
      digitalWrite(PinSelect2, HIGH);
      digitalWrite(PinSelect3, LOW);
      break;
    }
  case 5: 
    {
      digitalWrite(PinSelect0, HIGH);
      digitalWrite(PinSelect1, LOW);
      digitalWrite(PinSelect2, HIGH);
      digitalWrite(PinSelect3, LOW);
      break;
    }
  case 6: 
    {
      digitalWrite(PinSelect0, LOW);
      digitalWrite(PinSelect1, HIGH);
      digitalWrite(PinSelect2, HIGH);
      digitalWrite(PinSelect3, LOW);
      break;
    }
  case 7: 
    {
      digitalWrite(PinSelect0, HIGH);
      digitalWrite(PinSelect1, HIGH);
      digitalWrite(PinSelect2, HIGH);
      digitalWrite(PinSelect3, LOW);
      break;
    }
  case 8: 
    {
      digitalWrite(PinSelect0, LOW);
      digitalWrite(PinSelect1, LOW);
      digitalWrite(PinSelect2, LOW);
      digitalWrite(PinSelect3, HIGH);
      break;
    }
  case 9: 
    {
      digitalWrite(PinSelect0, HIGH);
      digitalWrite(PinSelect1, LOW);
      digitalWrite(PinSelect2, LOW);
      digitalWrite(PinSelect3, HIGH);
      break;
    }
  case 10: 
    {
      digitalWrite(PinSelect0, LOW);
      digitalWrite(PinSelect1, HIGH);
      digitalWrite(PinSelect2, LOW);
      digitalWrite(PinSelect3, HIGH);
      break;
    }
  case 11: 
    {
      digitalWrite(PinSelect0, HIGH);
      digitalWrite(PinSelect1, HIGH);
      digitalWrite(PinSelect2, LOW);
      digitalWrite(PinSelect3, HIGH);
      break;
    }
  case 12: 
    {
      digitalWrite(PinSelect0, LOW);
      digitalWrite(PinSelect1, LOW);
      digitalWrite(PinSelect2, HIGH);
      digitalWrite(PinSelect3, HIGH);
      break;
    }
  case 13: 
    {
      digitalWrite(PinSelect0, HIGH);
      digitalWrite(PinSelect1, LOW);
      digitalWrite(PinSelect2, HIGH);
      digitalWrite(PinSelect3, HIGH);
      break;
    }
  case 14: 
    {
      digitalWrite(PinSelect0, LOW);
      digitalWrite(PinSelect1, HIGH);
      digitalWrite(PinSelect2, HIGH);
      digitalWrite(PinSelect3, HIGH);
      break;
    }
  case 15: 
    {
      digitalWrite(PinSelect0, HIGH);
      digitalWrite(PinSelect1, HIGH);
      digitalWrite(PinSelect2, HIGH);
      digitalWrite(PinSelect3, HIGH);
      break;
    }
  }
  delay(ReadDelay);
}

The problem occurs when I observe the output here

Serial.println(Layer1LongSideData);
  Serial.println(Layer2LongSideData);
  Serial.println(Layer3LongSideData);
  Serial.println(Layer1ShortSideData);
  Serial.println(Layer2ShortSideData);
  Serial.println(Layer3ShortSideData);

I dont see any output...just blank spaces..

Layer1LongSideData[i] = char(digitalRead(ChipA));

digitalRead return 1 or 0, neither of which is a printable character.

Layer1LongSideData[i] = digitalRead(ChipA) + '0';

etc, may get you to where you want to be.

Thank you AWOL!. It worked. It was a good learning experience for me. I didn't think of using a AND operator. Thanks a Million!

But you aren't using an AND operator, and if you were, it wouldn't work.
An OR would though.

Sorry yes, My mistake :)..thank you very much once again..