I am creating a programme in which two Myoware devices are programmed at once. This is the programme:
const int iSensorPin = A1;
const int iMinThreshVal = 1;
const int iMaxThreshVal = 3000;
const int iSensor = A0;
const int iMinThreshVal1 = 1;
const int iMaxThreshVal1 = 3000;
void setup()
{
Serial.begin(115200); //Data rate needed
}
void loop()
{
int val = getAnalog(A0); // get Analog value
int iSensorVal=getAnalog(iSensor);
int val = getAnalog(A1); // get Analog value
int iSensorVal=getAnalog(iSensorPin);
Serial.print(iSensorVal); //To Allow a live log.
Serial.print(" ");
Serial.println(iSensorVal1);
delay(10);
}
However, I get these error messages:
C:\Users\Robin\Documents\Arduino\new_arduino_sketch_for_emg\new_arduino_sketch_for_emg.ino: In function 'void loop()':
new_arduino_sketch_for_emg:14: error: 'getAnalog' was not declared in this scope
int val = getAnalog(A0); // get Analog value
^
new_arduino_sketch_for_emg:16: error: redeclaration of 'int val'
int val = getAnalog(A1); // get Analog value
^
new_arduino_sketch_for_emg:14: error: 'int val' previously declared here
int val = getAnalog(A0); // get Analog value
^
new_arduino_sketch_for_emg:17: error: redeclaration of 'int iSensorVal'
int iSensorVal=getAnalog(iSensorPin);
^
new_arduino_sketch_for_emg:15: error: 'int iSensorVal' previously declared here
int iSensorVal=getAnalog(iSensor);
^
new_arduino_sketch_for_emg:20: error: 'iSensorVal1' was not declared in this scope
Serial.println(iSensorVal1);
^
exit status 1
'getAnalog' was not declared in this scope
Can someone explain what must be done to correct the code?