Carrying a static array of chars(product names) from slave Uno to Mega master

Hello all,

There are 10 barrels and i digitalread from their floats and send alarm mails if they were not changed for a certain time. Because of memory i needed a Mega.

digitaRead states could being sent right now without a problem.

Now i need to serve a list to user to let them pick product names(those names would be processed later by master to send alarm mails.) and also pick what delay they want(this certain time products were not changed yet) and send those datas to master.

I have a system that communicates via i2c:

MASTER: Mega2560+Ethernet Shield+DS1307+SD

SLAVE: Uno+Lcd keypad shield

I have a design like this:

2 page_counters are main. 1-Setup and 2-Start. If setup is choosed

2 subpage_counters appear

1-Pick products and 2-Pick mail delay. If 1 is picked than;

15 subpage2_counters for serving the name list to pick, that include something like

for(int i=0;i<=9;i++){
if(key == KEY_SELECT){
product[i++]= Product1;     // liquid named Product1 is Product1 till someone presses reset
}
elseif(key == KEY_RIGHT){
subpage2_counter++;

If 2 is picked something similar. I have two days to finish so i am opened all suggestions. What is the best way to to this?

These picks will be used in Master side here:

  for(int i =0 ; i<=9 ; i++){
    if(count[i] == 35){          /////    Write mail if 35 secs HERE IS MAIL DELAY
      if(sendEmail(i))
      Serial.println(F("Email sent"));
      else
      Serial.println(F("Email failed"));
    }
    if((count[i] >= 47) || (sensor[i] == 0)){
      count[i] = 0;
    }
    if(count[i] >= 45){
      File dataFile = SD.open("datalog.txt", FILE_WRITE);               // if the file is available, write to it:
      if(dataFile){
        if(i == 0){
          dataFile.println("Product1 has not been changed.");  // chars from slave here for datalog
          }else if(i == 1){
            dataFile.println("Product2 has not been changed.");
            }else if(i == 2){
              dataFile.println("Product3 has not been changed");
              }else if(i == 3){
                dataFile.println("Product4 has not beed changed");

And also here:

     Serial.println(F("Sending email"));
      client.println("To: ..... <............>");     // change to recipient address
      
      client.println("From: ...........<..............>");      // change to your address
      
      client.println("Subject: Empty Product");
      
      if(i == 0){
        client.println("Product1has not been changed for SOME MINUTES.");   // Here i am going to need those 2 arrays 1 for name and 1 for time
        }else if(i == 1){
          client.println("Product2 has not been changed for some minutes");
          }else if(i == 2){
            client.println("Product3 vs.

Diffuser:
Hello all,

There are 10 barrels and i digitalread from their floats and send alarm mails if they were not changed for a certain time. Because of memory i needed a Mega.

digitaRead states could being sent right now without a problem.

Now i need to serve a list to user to let them pick product names(those names would be processed later by master to send alarm mails.) and also pick what delay they want(this certain time products were not changed yet) and send those datas to master.

Lemme be the first to say: "huh?"

The words appear English but can't figure out what language this really is.

        if(i == 0){
          dataFile.println("Product1 has not been changed.");  // chars from slave here for datalog
          }else if(i == 1){
            dataFile.println("Product2 has not been changed.");
            }else if(i == 2){
              dataFile.println("Product3 has not been changed");
              }else if(i == 3){
                dataFile.println("Product4 has not beed changed");

Or

   dataFile.print("Product ");
   dataFile.print(i);
   dataFlle.println(" has not been changed.");

Ok sorry i had to write it quickly.

Where exacty you did not understand?

There are many of product names of different kinds of bleaches, alkali boosters, main wash liquids, support wash liquids etc. When these are finished and if washing moves on without these liquids washing performance is affected, that is why i designed this system to warn the responsible person, and not all of the users use same liquids. But they use maximum 10 chemicals, that is why i want them to pick from a list; also when a product finishes, he may want empty product mails 10minutes later, I may want mails 5minutes later and She may want empty product mails 3 minutes later if barrels were not changed with their newer(full) ones.

Pauls those products have specific names, like one of our alkali boosters' name is Clax Master... Those product1 ,2 ,3 were examples...

Then place the names in an array, and internally work with numbers. That's a lot easier on your programming.

It seems like you have ten products and ten sensors to tell they're empty. That's one piece of code running ten times, each time for a different sensor. The names go in an array, and you just call from there.

char products[][] = {"product name 1",
"product name 2",
"product name 3"};


   dataFile.print(products[i]);
   dataFlle.println(" has not been changed.");

Place that array in PROGMEM to save heaps of RAM. You'd be surprised at how much you can squeeze onto an ATmega328p.