I have a Quadrupod (Modified SQ3) in which I put some footsensors. They are really simple ones, the old lynxmotion footsensor version. So not the one pressure sensitive one, but more like a switch. I am using something similar to the code below (sample A) in a modified version of the Phoenix quadruped code. With the code below and running it in walkmode (and not actually walking) it gives me value of over 400. But if I switch to bodymove mode in which I wanted to test the sensors. It gives me totally different value. LegSensorA is still above 400, but LegsensorB and especcially the last 2 (C and D) give me considerable lower value. I am calling the routine from the main loop (see code sample 2). I cannot figure out why this difference occurs.
Sample A:
[code]void ScanFootSensor(void) {
int LegSensorA = analogRead(A1);
int LegSensorB = analogRead(A2);
int LegSensorC = analogRead(A3);
int LegSensorD = analogRead(A4);
Serial.begin(38400);
Serial.print(LegSensorA);
Serial.print(LegSensorB);
Serial.print(LegSensorC);
Serial.print(LegSensorD);
}
Sample B:
//=============================================================================
// Loop: the main arduino main Loop function
//=============================================================================
void loop(void)
{
ScanFootSensor();[/code]