Hello.
I am trying to assign an array"Locoadding[0]" to another array"textfield[0]" and want to display the value in the serial monitor it is showing %
Thanks in advance
char* TempLocoAddress[4] = {"1830", "3", "999", "4444"}; //Setting the Default loco addresses at the startup
char* LocoAddress[4] = {"1830", "3", "999", "4444"}; //Setting the Default loco addresses at the startup
char Locoadding[1][5] = {'\0'}; //Setting the Default loco addresses at the startup
#define TEXT_LEN 10
char textfield[TEXT_LEN + 1] = "";
#define maxLocos 4
void setup() {
Serial.begin(9600);
Locoadding[0][5] = "21234";
textfield[0] = Locoadding[0][5];
Serial.print ("Locoadding[0]: " );
Serial.print(Locoadding[0][5]); // this is showing blank
Serial.println ();
addLocoAddressToArray(textfield[0]);
}
void loop() {
}
void addLocoAddressToArray(char LocoToAdd[]) {
Serial.print ("locotoadd : " );
Serial.print(LocoToAdd); \\ this one is also showing %
Serial.println ();
int k = 1;
if (LocoToAdd != "") {
LocoAddress[0] = LocoToAdd[0];
for (int j = 0; j <= maxLocos - 1 ; j++)
{
Serial.print (" k ");
Serial.print(k);
Serial.println ();
LocoAddress[k] = TempLocoAddress[j];
k++;
if (k == 3) {
j = maxLocos;
}
}
for (int i = 0; i <= maxLocos - 1 ; i++)
{
Serial.println ();
Serial.print (i);
Serial.print (" LocoAddress ");
Serial.print (LocoAddress[i]);
Serial.println ();
}
}
}