#include "Low_Pass_filter.h"
LowPass<2> lp(1,1e3,true);

void setup() {
  Serial.begin(115200);
}

void loop() {
  // Read pin A0 and compute current in mA
  // -- replace these two lines with your own sensor --
  int analogValue = analogRead(A0);
  float xn = 0.001*(analogValue*5.0/1023.0 - 2.503)/0.185*1000;

  // Compute the filtered signal
  float yn = lp.filt(xn);

  // Output
  Serial.print(xn);
  Serial.print(" ");
  Serial.print(yn);
  Serial.println();
  delayMicroseconds(200);
}