Skip to content

Instantly share code, notes, and snippets.

@ceiborg
Created March 14, 2020 23:46
Show Gist options
  • Save ceiborg/291eecaac5c9faab3cfeb4f5f4f61ef4 to your computer and use it in GitHub Desktop.
Save ceiborg/291eecaac5c9faab3cfeb4f5f4f61ef4 to your computer and use it in GitHub Desktop.
IIR Filter - Low f.
void setup() {
Serial.begin(9600);
}
int v = 0;
void loop() {
int c = analogRead (A0);
Serial.print(c);
Serial.print(",");
v += (c - v) * 0.06f;
Serial.println(v);
delay(10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment