int FSR1Pin = A0; // the FSR and 10K pulldown are connected to a0 int FSR2Pin = A1; int FSR3Pin = A2; int FSR4Pin = A3; int FSR1; // the analog reading from the FSR resistor divider int FSR2, FSR3, FSR4; int FSR1Voltage; int FSR2Voltage, FSR3Voltage, FSR4Voltage;// the analog reading converted to voltage unsigned long fsrResistance; // The voltage converted to resistance, can be very big so make "long" unsigned long fsrConductance; long fsrForce; // Resistance converted to force void setup(void) { pinMode(FSR1Pin, INPUT); pinMode(FSR2Pin, INPUT); pinMode(FSR3Pin, INPUT); pinMode(FSR4Pin, INPUT); Serial.begin(9600); } void loop(void) { FSR1 = analogRead(FSR1Pin); FSR2 = analogRead(FSR2Pin); FSR3 = analogRead(FSR3Pin); FSR4 = analogRead(FSR4Pin); if( FSR1 || FSR2 || FSR3 || FSR4 <=0) { Serial.print("SYSTEM OFF"); Serial.println(); delay(1000); } else if(FSR1 & FSR2 & FSR3 & FSR4>0) { Serial.println(); Serial.print("Digital FSR reading = "); Serial.print(FSR1); Serial.print(" , "); Serial.print(FSR2); Serial.print(" , "); Serial.print(FSR3); Serial.print(" , "); Serial.print(FSR4); Serial.println(); // analog voltage reading ranges from about 0 to 1023 which maps to 0V to 5V (= 5000mV) FSR1Voltage = map(FSR1, 0, 1023, 0, 5000); FSR2Voltage = map(FSR2, 0, 1023, 0, 5000); FSR3Voltage = map(FSR3, 0, 1023, 0, 5000); FSR4Voltage = map(FSR4, 0, 1023, 0, 5000); Serial.print("FSRVoltage in mV = "); Serial.print(FSR1Voltage); Serial.print(" , "); Serial.print(FSR2Voltage); Serial.print(" , "); Serial.print(FSR3Voltage); Serial.print(" , "); Serial.print(FSR4Voltage); Serial.println(); delay(1000); } }