Skip to content

Instantly share code, notes, and snippets.

@asheeshr
Last active July 10, 2020 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asheeshr/bc87f8c6486f649ef029 to your computer and use it in GitHub Desktop.
Save asheeshr/bc87f8c6486f649ef029 to your computer and use it in GitHub Desktop.
Simple Test File for Microsmooth Library
#include <microsmooth.h>
uint16_t *ptr;
void setup()
{
Serial.begin(9600);
pinMode(3, INPUT);
ptr = ms_init(EMA);
if(ptr == NULL) Serial.println("No memory");
}
void loop()
{
int i = pulseIn(3, HIGH, 25000);
Serial.print("Input: "); Serial.println(i);
Serial.println(ema_filter(i, ptr));
Serial.println("Back");
delay(100);
}
@irwanayeah
Copy link

irwanayeah commented Jul 10, 2020

@asheeshr great, code work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment