Hi there,

I am fairly new to coding and having a few issues trying to call a function. Would be very grateful if someone can explain why it wont compile, for when I try the error message appears: 'too few arguments to function ‘double discreteVal(int)’ and it highlights the line #define PUMPOUT 13? I have written this piece of code to convert a digital signal to a more analogous estimate.

```
#include <math.h> //Used for the calculation of the discrete time filter
/*Glodal variables used for the discrete time filter*/
#define PUMPOUT 13
int x, levelSensor;
int levelSetting = 512;
void setup()
{
pinMode (PUMPOUT, OUTPUT); //sets pump as output
Serial.begin(9600);
}
void loop()
{
levelSensor = analogRead(0);
if (levelSensor >= levelSetting)
{
digitalWrite(PUMPOUT, HIGH);
x = 1023;
discreteVal(x);
}
else
{
digitalWrite(PUMPOUT,LOW);
x = 0;
discreteVal(x);
}
Serial.print(discreteVal());
}
/*A function to calculate a filtered value
for the flow rate of run-off*/
double discreteVal (int f)
{
int freq = 2000;
int k = 1; //Sets spring constant
double omega_n = 2*M_PI/freq;
double m = k/(omega_n*omega_n); // standard eq relating mass, stiffness and natural freq
double c = 2*sqrt(m*k); // standard eq relating mass, stiffness and damping
int dt = 1; // discrete time step
double a = (m/(dt*dt) + c/dt + k); //coeff of xi
double b = (-2*m/(dt*dt) - c/dt); // coeff of xi-1
double cc = m/(dt*dt); // coeff of xi-2
double x_prev_prev, x_prev, x_now, dtfSignal;
x_now = (f - (b*x_prev + cc*x_prev_prev))/a; //rearranging EoM for any xi as a variable
x_prev_prev = x_prev; // cascade
x_prev = x_now; // cascade
dtfSignal = x_now*2;
return dtfSignal;
}
```

Many thanks