Hello everyone!
I use an EMG sensor from Elemyo. Everything works correctly on Arduino MEGA, the ELEMYO library is connected, filtering too.
But when connected to ESP32 (powered by 5 V, signal on GPIO 33, 32) and using the same library - the microcontroller infinitely reboots
I tried different pins and turned off filtering - the effect is the same.
Or do I need another way of filtering?
I will be very grateful for your help
#include <ELEMYO.h>
#define CSpin 10
#define sensorInPin1 32 // analog input pin for the first sensor
#define sensorInPin2 33 // analog input pin for the second sensor
int sensorValue1 = 0; // value read from the first sensor
int bandStopValue1 = 0;
int bandPassValue1 = 0;
int lowPassValue1 = 0;
int sensorValue2 = 0; // value read from the second sensor
int bandStopValue2 = 0;
int bandPassValue2 = 0;
int lowPassValue2 = 0;
ELEMYO MyoSensor(CSpin);
void setup() {
Serial.begin(115200);
MyoSensor.gain(x1);
pinMode(sensorInPin1, INPUT);
pinMode(sensorInPin2, INPUT);
}
void loop() {
// Read and process first sensor
sensorValue1 = analogRead(sensorInPin1);
bandStopValue1 = MyoSensor.BandStop(sensorValue1, 50, 4);
lowPassValue1 = MyoSensor.LowPass(sensorValue1, 80, 2);
bandPassValue1 = MyoSensor.BandPass(sensorValue1, 30, 80, 2);
// Read and process second sensor
sensorValue2 = analogRead(sensorInPin2);
bandStopValue2 = MyoSensor.BandStop(sensorValue2, 50, 4);
lowPassValue2 = MyoSensor.LowPass(sensorValue2, 80, 2);
bandPassValue2 = MyoSensor.BandPass(sensorValue2, 30, 80, 2);
// Print results to the Serial Monitor
Serial.print("Sensor 1: ");
Serial.print(sensorValue1);
Serial.print(" ");
Serial.print("Sensor 2: ");
Serial.println(sensorValue2);
delay(10);
}
Serial:

