Last active
April 14, 2022 03:47
-
-
Save allrobot/1d105671a5186adb792bfbc5d8bd5030 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "EMGFilters.h" | |
const int SensorInputPin[] = {A0, A1, A2, A3, A4, A5}; | |
EMGFilters myFilter[6]; | |
SAMPLE_FREQUENCY sampleRate = SAMPLE_FREQ_500HZ; | |
NOTCH_FREQUENCY humFreq = NOTCH_FREQ_50HZ; | |
void setup() | |
{ | |
for (int i = 0; i < 6; i++) | |
{ | |
myFilter[i].init(sampleRate, humFreq, true, true, true); | |
} | |
Serial.begin(115200); | |
} | |
void loop() | |
{ | |
// int x1= square(myFilter[0].update(analogRead(SensorInputPin[0]))); | |
// Serial.printf("analogRead:%d\n",analogRead(SensorInputPin[0])); | |
// Serial.printf("%d %d %d %d %d %d\n",x1,x2,x3,x4,x5,x6); | |
int x[6] = {0}; | |
for (int index = 0; index < 4; index++) | |
{ | |
x[index] = myFilter[index].update(analogRead(SensorInputPin[index])); | |
delayMicroseconds(2000); | |
} | |
// Serial.printf("%d %d %d %d %d %d\n", x[0], x[1], x[2], x[3], x[4], x[5]); | |
Serial.printf("%d %d %d %d\n", x[0],x[1],x[2],x[3]); | |
// Serial.printf("%d %d %d\n", x[0],x[1],x[2]); | |
//Serial.printf("%d",x1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment