too many arguments to function 'void refreshParams()'

Hi all. Please, where is problem? hmmm… :confused:

#include "KWP.h"
#include "FISLib.h"

#define MAX_CONNECT_RETRIES 2
#define NENGINEGROUPS 4
#define NDASHBOARDGROUPS 2
#define NMODULES 2

// KWP
#define pinKLineRX 2
#define pinKLineTX 3
KWP kwp(pinKLineRX, pinKLineTX);

// FIS
#define pinENABLE 8
#define pinCLOCK 13
#define pinDATA 11
FISLib LCD(pinENABLE, pinCLOCK, pinDATA);

#define pinButton 5


int engineGroups[NENGINEGROUPS] = { 3, 7, 11, 12 };
int dashboardGroups[NDASHBOARDGROUPS] = { 1, 2 };

// Note: Each unit can have his own baudrate.
// If 10400 not works whit your unit try whit other, posible values are:
// 115200, 57600, 38400, 31250, 28800, 19200,  14400, 10400, 9600, 4800, 2400, 1200, 600, 300

KWP_MODULE engine    = { "-MOTOR-",     ADR_Engine,  9600,    engineGroups,    NENGINEGROUPS};
KWP_MODULE dashboard = { "-BUDIKY-", ADR_Dashboard, 10400, dashboardGroups, NDASHBOARDGROUPS};
KWP_MODULE *modules[NMODULES] = { &dashboard, &engine };

KWP_MODULE *currentModule = modules[0];
int currentGroup = 0;
int currentSensor = 0;
int nSensors = 0;
int maxSensors = 4;
int connRetries = 0;

int count = 0;


void refreshParams(){
  if (digitalRead(pinButton) == HIGH){
  currentSensor++;
    if (currentSensor < nSensors - 1) currentSensor++;
    else {
      currentSensor = 0;
      if (currentGroup < (currentModule->ngroups) - 1) currentGroup++;
      else {
        //if (currentModule->addr == ADR_Dashboard) currentModule = modules[1];
        //else currentModule = modules[0];
        //currentGroup = 0;
        kwp.disconnect();
        while (digitalRead(pinButton) == HIGH);
     }  
   } 
  }
}

void setup() {
 
  Serial.begin(9600);
  for (int i = 0; i < 8; i++) {
    LCD.showText("-FIS-", "BLOCKS");
    delay(500);
  }
  for (int i = 0; i < 8; i++) {
    LCD.showText("OCTAVIA", "-TDI-");
    delay(500);
  }
  for (int i = 0; i < 8; i++) {
    LCD.showText("AHOJ", "MILACIK");
    delay(500);
  }
 }
 
void loop() {
  if (digitalRead(pinButton) == HIGH){    
    currentSensor++;
    while (digitalRead(pinButton) == HIGH);        
  }
  if (!kwp.isConnected()) {
    LCD.showText("PRIPAJAM", currentModule->name);
    if (kwp.connect(currentModule->addr, currentModule->baudrate)) {
      LCD.showText("PRIPOJENE", "CITAM");
      connRetries = 0;
    }
    else { // Antiblocking
      if (connRetries > MAX_CONNECT_RETRIES) {
        if (currentModule->addr == ADR_Dashboard) currentModule = modules[1];
        else currentModule = modules[0];
        currentGroup = 0;
        currentSensor = 0;
        nSensors = 0;
        connRetries = 0;
      }
      else connRetries++;
    }
  }
  else {
    SENSOR resultBlock[maxSensors];
    nSensors = kwp.readBlock(currentModule->addr, currentModule->groups[currentGroup], maxSensors, resultBlock);
    if (resultBlock[currentSensor].value != "") {
      LCD.showText(resultBlock[currentSensor].desc, resultBlock[currentSensor].value + " " + resultBlock[currentSensor].units);
      if (count > 8 ) {
        refreshParams;
        count = 0;
      }
      else count++;
     }
     else {
      refreshParams;
      count = 0;
    }
  }
}

No error code, but I need after touch the button change nSensors around… So pripajam budiky-pripojene, citam,…/touch/1.value,/touch/2.value,/touch/3.value,/touch/4.value/touch/pripajam motor, pripojene, citam,…/touch/1.value,/touch/2.value,/touch/3.value,/touch/4.value around… can anyone help me?

Please read the forum guidelines in the sticky post. You should use code tags for code, not quotation tags. See how the forum has corrupted your code? Code does not normally contain smilies! Please edit your post above and correct it.

Also please post the error messages in full. You can copy them with one click from the IDE. Post that in code tags also.

This is the problem:

refreshParams(1);

What it the "1" for?

void refreshParams(){

The function declaration for refreshParams() says that it takes no arguments.

refreshParams(1);

Has an argument, thus the error.

thanks, it´s solved. Only refreshParams; but I need with this button change not only currentSensor++ but change the currentModule++ too around. It is possible?

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom... :)

Hi Tom, thanks. I read it. It´s OK? Can you help me with this?

Maybe like this

void refreshParams(){
  if (digitalRead(pinButton) == HIGH){
    currentSensor++;
    if (currentSensor < nSensors - 1) currentSensor++;
    else {
      currentSensor = 0;
    }
    if (currentGroup < (currentModule->ngroups) - 1) currentGroup++;
    else {
      //if (currentModule->addr == ADR_Dashboard) currentModule = modules[1];
      //else currentModule = modules[0];
      //currentGroup = 0;
      kwp.disconnect();
    }
    while (digitalRead(pinButton) == HIGH);
  }
}

after button touch no reaction... :(

If I were you, I'd add some debug prints to find out what your code is doing.