help array

Hello everyone,
I have a question,
If you send an array through a serial consisting of 10 digits for example:
Char string [10]; (L +, a-, f0, x +, y-, y +, A1, on, off, nd)

At the receiver I can re dial the entire array, and call in the program sequence each array?
For example:
String [1]; // Equal to a-

Char string [10]; (L +, a-, f0, x +, y-, y +, A1, on, off, nd)

That doesn't look like 10 characters to me. (And it's 'char', not 'Char')
That line won't initialise a char array, either.

And this makes very little sense:-

At the receiver I can re dial the entire array, and call in the program sequence each array?
For example:
String [1]; // Equal to a-

Perhaps you should try again, with a more accurate representation of what you want to do?

Once you get what OldSteve states - then if your chars are in variables, then f0 is a correct variable name and will work if it's a char or byte type but what are L+, a-, x+, ... ??

a char array holds char so

char str1[] = {'a', 'r', 'd', 'u', 'i', 'n', 'o'}; // won't have a trailing null char
char str2[] = {'a', 'r', 'd', 'u', 'i', 'n', 'o', '\0'}; // with the trailing null char
char str3[ ] = "arduino"; // will automatically have the trailing null char

are valid definitions

Ok,
I have to send an array composed of 10 numbers or letters in two pairs.
Then 20 characters separated by one, each 2 characters.
I just wanted to use the array to transmit 10 variables, without re declare them.
What variable type should I use?
And then you can re dial in reception throughout the complete array?
I apologize for the lexicon,
but I do not know the C programming
For now I'm 'considering whether I could use Arduino.
And yet I could not compose a program without the manual at hand.
Now I do not have the manual at hand, and I'm 'posting from smartphones.

Thanks in advance for your patience.

alpha1504:
Ok,
I have to send an array composed of 10 numbers or letters in two pairs.
Then 20 characters separated by one, each 2 characters.
I just wanted to use the array to transmit 10 variables, without re declare them.
What variable type should I use?

I'm afraid that the above still doesn't make a lot of sense to me.

If you were to show an exact example of what you want to send, it would help.
Do you perhaps mean something like this:-

// This holds 20 characters:-
char myString[10][2] =
{
    {'L', '+'},
    {'a', '-'},
    {'f', '0'},
    {'x', '+'},
    {'y', '-'},
    {'y', '+'},
    {'A', '1'},
    {'o', 'n'},
    {'o', 'f'},
    {'n', 'd'}
};

Or this:-

// This holds 30 characters:-
char myString2[10][3] = {"L+", "a-", "f0", "x+", "y-", "y+", "A1", "on", "of", "nd"};

Or something else?

For now I'm 'considering whether I could use Arduino.

I can answer this - yes. :slight_smile:

See Serial Input Basics - updated - Introductory Tutorials - Arduino Forum It will answer all your questions.

you know that you don't need to build a specific string for this right?

just do multiple Serial.print() or Serial.write() to send you data, one element by one element.