error: initializing argument

I am writing a thermostat sketch... I changed the args 2,3 on scheduleArray from char* to int. I changed the calls too. What does "error: initializing argument" mean? Do they actually mean to say "error initializing argument"? (without :). The name is "item", but it worked before when it was a string.

thermostat23:545:5: error: initializing argument 3 of 'int scheduleArray(char*, int, int, int)' [-fpermissive]

int scheduleArray(char *Block, int rw, int item, int data) {

^

Hint: we can't see your code.

Edit: I can't believe I had to type that :frowning:

Can you please post your code. Please make sure you use the code tag. Debugging snippets of code is not helpful to you or us.

Here is function:

int scheduleArray(char *Block, int rw, int item, int data) {
  int block;
  int out;
  int arrTimeHH[8], arrTimeMM[8], arrTemp[8];

  out = 0;
  block = atoi(Block);
  //strcpy(block,Block);
  //Serial.print('['); Serial.print(item); Serial.print(']');
  if (rw == READ) { //Read data
    EEPROM.get(210, arrTimeHH);
    EEPROM.get(230, arrTimeMM);
    EEPROM.get(250, arrTemp);
    switch (item) {
      case TIME_HH:
        out = arrTimeHH[block];
        if (out < 0) || (out > 23) {
          errHand(56620);
          return 5;
        }
        break;
      case TIME_MM:
        out = arrTimeMM[block];
        if (out < 0) || (out > 59) {
          errHand(56620);
          return 5;
        }
        break;
      case TEMPERATURE:
        out = arrTemp[block];
        if (out < 50) || (out > 100) {
          errHand(56621);
          return 5;
        }
        break;
    }
  }
  if (rw == WRITE) { //Write data
    switch (item) {
      case TIME_HH:
        if (data < 0) || (data > 23) {
          errHand(56622);
          return 5;
        }
        arrTimeHH[block] = data;
        EEPROM.put(210, arrTimeHH);
        break;
      case TIME_MM:
        if (data < 0) || (data > 59) {
          errHand(56622);
          return 5;
        }
        arrTimeMM[block] = data;
        EEPROM.put(230, arrTimeMM);
        break;
      case TEMPERATURE:
        if (data < 0) || (data > 23) {
          errHand(56623);
          return 5;
        }
        arrTemp[block] = data;
        EEPROM.put(250, arrTemp);
        break;
    }
  }
  return out;
}

And here is whole sketch…:
It is 28000 characters… too big to post… so i’ll attach it…

thermostat23.ino (29 KB)

    if (millis() - tempMS > timeout) {
      tempSetting = scheduleArray(currentBlock, READ, TEMPERATURE);
    }

The scheduleArray() function takes 4 arguments.

  //tempSetting = scheduleArray(currentBlockI, 'r', "temperature", 0);

The 2nd & 3rd arguments in this (commented out) call are not the right types.

SOLVED: I found I had a pin named "AC" so maybe that was why. I changed the macro to "COOL" and it works now.

A pin named AC had no bearing on this problem. Your code also has way more problems than just this one function call.

For example, here's a problem in the fanLED() function:

  if (fanMode == ALL_TIME) flasher(GREEN, 1000, 10); 0, 3, 1000, 0, 0, 0); //All time - green FULL

That's a syntax error.

Here's more syntax errors at file scope:

systemAction();
systemUse();
 tempReading();
    currentBlockID();
     HCFanON();
       flasher(int, int, int);
 tempTempSet(int);
 readEEprom(String);

Those are not valid function declarations. (Also, I noticed that there is a function named HCFanOn(), but your code calls HCFanON(). C++ is case sensitive!)