I am using the code below to interface the Arduino nano and android cell phone to enable serial communication through the USB port. I downloaded the filter library from GitHub GitHub - JonHub/Filters: A realtime digital signal processing (DSP) library for Arduino
I am getting an error saying thet the library is not found.
I would really appreciate some suggestions on this.
Here is my code:
//This code is for arduino communicating to android phone through USb serial port.
//For arduino nano
#include <Filters.h> //implements digital filters which mimic the analog filter, keep track of variable statistics in realtime
char data_read; //character datatype takes up to 1 byte of memory
unsigned int analog_out;
unsigned long time;
float filterFrequency = 10.0;
FilterOnePole lowpassFilter( LOWPASS, filterFrequency );//implements digital RC type filter; both highpass and lowpass
void setup()
{
Serial.begin(115200); //open the serial port and set the baud rate for communication
// create a one pole (RC) lowpass filter
}
void loop()
{
}
void serialEvent() { //Used when data is unavailable yet
if (Serial.available()) //checks the number of bytes available for reading from the serial port
{
data_read = Serial.read();
if (data_read == '0') {
Serial.print("#");
//Serial.print("10100");
analog_out = lowpassFilter.input( analogRead(0) );
Serial.print(analog_out + 10000);
Serial.print(":");
//Serial.print("20200");
analog_out = lowpassFilter.input( analogRead(1) );
Serial.print(analog_out + 20000);
Serial.print(":");
//Serial.print("30300");
analog_out = lowpassFilter.input( analogRead(2) );
Serial.print(analog_out + 30000);
Serial.print("p");
}
/*if(data_read == '0' || data_read == '1' || data_read == '2' || data_read == '3' || data_read == '4' || data_read == '5'){
analog_out = lowpassFilter.input( analogRead( data_read-48 ) );
Serial.print((analog_out)+(data_read-48)*10000);
Serial.print(":");
}else if(data_read =='p'){
Serial.print("p");
}*/
}
}
Here is my error message:
Arduino: 1.8.5 (Windows 10), Board: "Arduino Nano, ATmega328P"
C:\Users\daphn\Documents\Arduino\Analog_Serial_out\Analog_Serial_out.ino:4:129: fatal error: Filters.h: No such file or directory
#include <Filters.h> //implements digital filters which mimic the analog filter, keep track of variable statistics in realtime
^
compilation terminated.
exit status 1
Error compiling for board Arduino Nano.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.