i'm very beginning on arduino. I want to make to command loop of the 8 sensors with different address for sensorA to sensorH. I'm used command all of each 8 command duplicate only change byte dataA --> dataB --> dataC --...--->dataH than the program storage space are go very high. how can i should do for use byte type in one for loop
PS: I'm already use char alphabet[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ"; and then char to string and mix it. then it come out with that name not dataA that i want.
char alphabet[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ";
void setup() {
Serial.begin(9600);
Serial.println("Start :");
}
void loop() {
for(int j = 1; j < 9; j++) {
byte dataA[] = {0x01, 0x03, 0x00, 0x00, 0x00, 0x02, 0xC4, 0x0B};
byte dataB[] = {0x02, 0x03, 0x00, 0x00, 0x00, 0x02, 0xC4, 0x38};
byte dataC[] = {0x03, 0x03, 0x00, 0x00, 0x00, 0x02, 0xC5, 0xE9};
byte dataD[] = {0x04, 0x03, 0x00, 0x00, 0x00, 0x02, 0xC4, 0x5E};
byte dataE[] = {0x05, 0x03, 0x00, 0x00, 0x00, 0x02, 0xC5, 0x8F};
byte dataF[] = {0x06, 0x03, 0x00, 0x00, 0x00, 0x02, 0xC5, 0xBC};
byte dataG[] = {0x07, 0x03, 0x00, 0x00, 0x00, 0x02, 0xC4, 0x6D};
byte dataH[] = {0x08, 0x03, 0x00, 0x00, 0x00, 0x02, 0xC4, 0x92};
Serial.println(j);
Serial.println(alphabet[j]);
Serial.println(data[j]);
delay (2000);
}
}
This code i'm try to make string name "dataA" from "j" but it is just "dataA" not the command byte type..
Thank you for Reading my problem and look forward for answer.