Having trouble with character array

I have been trying for days to figure out how to make an array that would help label my serial info. I have three sensors that are reading leds and printing values to my serial monitor. So far what I get on my serial monitor is=
A0=### A0=### A0=### A0=### A0=### A0=###
A1=### A1=### A1=### A1=### A1=### A1=###
A2=### A2=### A2=### A2=### A2=### A2=###
I know I need to make a character array of some sorts but I really do not know how to do it to get what I want. I want to take the (k = 0 ; k < 6 ; k++) in the code and add it to a character array so that it will cycle through them.

Something like= char Colors = (Yellow, White, Red, Uv, Blue, Green);
so that the outcome would be=

Yellow A0=### White A0=### Red A0=### Uv A0=### Blue A0=### Green A0=###
Yellow A1=### White A1=### Red A1=### Uv A1=### Blue A1=### Green A1=###
Yellow A2=### White A2=### Red A2=### Uv A2=### Blue A2=### Green A2=###

If there is someone who could please help me out there I would greatly appreciate it. The code below is where I need help. I have the areas marked with *** showing what I am trying to do. Just don't know how to do it or what to write to make it happen.

void loop()
{
for(j = 0 ; j < 6 ; j++)

{
***for(k = 0 ; k < 6 ; k++)
analogWrite(LED[j],255);
delay(100);
analogWrite(pcellgnd, LOW); //A0 Ground
analogWrite(ptrangnd, HIGH); //A1 Ground
analogWrite(uvptrangnd, HIGH); //A2 Ground
delay(3000);
***Serial.print(Colors[k]);
Serial.print("A0= ");
Serial.println(1024-analogRead(A0)); // PRINT VALUES
delay(100);
analogWrite(LED[j],0);
}
for(j = 0 ; j < 6 ; j++)
{
***for(k = 0 ; k < 6 ; k++)
analogWrite(LED[j],255);
delay(100);
analogWrite(pcellgnd, HIGH); //A0 Ground
analogWrite(ptrangnd, LOW); //A1 Ground
analogWrite(uvptrangnd, HIGH); //A2 Ground
delay(3000);
***Serial.print(Colors[k]);
Serial.print("A1= ");
Serial.println(1024-analogRead(A1)); // PRINT VALUES
delay(100);
analogWrite(LED[j],0);
}
for(j = 0 ; j < 6 ; j++)
{
***for(k = 0 ; k < 6 ; k++)
analogWrite(LED[j],255);
delay(100);
analogWrite(pcellgnd, HIGH); //A0 Ground
analogWrite(ptrangnd, HIGH); //A1 Ground
analogWrite(uvptrangnd, LOW); //A2 Ground
delay(3000);
***Serial.print(Colors[k]);
Serial.print("A2= ");
Serial.println(1024-analogRead(A2)); // PRINT VALUES
delay(100);
analogWrite(LED[j],0);
}
analogWrite(LED[j],0);
delay(100);

}

Thank you in advanced for all of those who read this post.

are you looking for something along the lines of

  char* colors[]={"Yellow", "White", "Red", "Uv","Blue", "Green"};
  for (int i = 0; i < 6; i++){
      Serial.println(colors[i]);
}

would print

Yellow
White
Red
Uv
Blue
Green

Hi,
Welcome to the forum.

Is this to do with this thread?

https://forum.arduino.cc/index.php?topic=486991.msg3323110#msg3323110

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Please post your entire code, void setup() is missing for a start.

Thanks.. Tom.. :slight_smile:

Thank you for the reply horace. For some reason I can not get

char* colors[]={"Yellow", "White", "Red", "Uv","Blue", "Green"};
for (int i = 0; i < 6; i++){
Serial.println(colors*);*
to work. It just prints a bunch of nonsense. I have literally looked at pages of info for character strings and everything I try will not work.

jjohn77:
Thank you for the reply horace. For some reason I can not get

char* colors[]={"Yellow", "White", "Red", "Uv","Blue", "Green"};
for (int i = 0; i < 6; i++){
Serial.println(colors*);*
to work. It just prints a bunch of nonsense. I have literally looked at pages of info for character strings and everything I try will not work.
[/quote]Post.Your. Code.
In code tags this time

you need an array index?

char* colors[]={"Yellow", "White", "Red", "Uv","Blue", "Green"};
  for (int i = 0; i < 6; i++){
      Serial.println(colors[i]);

horace:
you need an array index?

char* colors[]={"Yellow", "White", "Red", "Uv","Blue", "Green"};

for (int i = 0; i < 6; i++){
      Serial.println(colors[i]);

No, that's why I asked for code tags.

I thought you were given an answer to this question in your other Thread

Why have you started a new Thread about the same project?

Please click Report to Moderator and ask to have them merged

...R