User Manual

// the time cost should be measured each loop
/*------------start here-------------------*/
timeStamp = micros();
int Value = analogRead(SensorInputPin);
// filter processing
int DataAfterFilter = myFilter.update(Value);
int envlope = sq(DataAfterFilter);
// any value under threshold will be set to zero
envlope = (envlope > Threshold) ? envlope : 0;
timeStamp = micros() - timeStamp;
if (TIMING_DEBUG) {
// Serial.print("Read Data: "); Serial.println(Value);
// Serial.print("Filtered Data: ");Serial.println(DataAfterFilter);
Serial.print("Squared Data: ");
Serial.println(envlope);
// Serial.print("Filters cost time: "); Serial.println(timeStamp);
// the filter cost average around 520 us
}
/*------------end here---------------------*/
// if less than timeBudget, then you still have (timeBudget - timeStamp) to
// do your work
delayMicroseconds(500);
// if more than timeBudget, the sample rate need to reduce to
// SAMPLE_FREQ_500HZ
}
Calibration
Calibration is recommended for every time when you use it, for the EMG signal is different in different position even of the
same person.
1. Modify the variable Threshold in the sample code to 0, namely: static int Threshold = 0;
2. Upload the sample code to Arduino control board and open the serial monitor of Arduino IDE to check the printed value.
3. Relax the arm muscle and check the printed value of serial port. Calm down and relax for a while to check and record the maximum value printed by the serial monitor. If
the value is too large, such as more than 1000, you can try fine-tune position of the dry electrode.
(/wiki/index.php/File:%E8%82%8C%E7%94%B5%E4%BF%A1%E5%8F%B7_%E6%95%B0%E6%8D%AE.png)
4. Modify the variable Threshold in the sample code to the recorded maximum value, and reload the sample code to Arduino control board.
(/wiki/index.php/File:Warning_yellow.png)