Using Multiple FSR's

Hi there,

Im very new to the Arduino scene and am having some trouble using multiple FSR's. Basically I have an LED wired to each individual FSR and want it to light up at full brightness whenever the FSR detects pressure, however, I can only ever get one to work at a time or both light up when one FSR detects pressure.

Here is the code I have currently written up:

int pressurePin1 = A1;
int LEDpin1 = 11;
int force;
int LEDpin2 = 10;
int pressurePin2 = A0;

void setup() {
pinMode(LEDpin1, OUTPUT), (LEDpin2, OUTPUT);
Serial.begin(9600);
}

void loop() {
force = analogRead(pressurePin1), (pressurePin2);
Serial.println(force);
if (force > 300)
{
digitalWrite(LEDpin1, HIGH), (LEDpin2, HIGH);
}
else
{
digitalWrite(LEDpin1, LOW), (LEDpin2, LOW);
}
delay(100);
}

All help and comments would be very greatly appreciated :slight_smile: :slight_smile:

Learning a bit of the basics of C/C++ might sound like a good idea.

What do you expect the first line in loop() to do. Assign two values to one variable?

Same for the digitalWrite.

You need two separate analogReads and two variables; you also need two digitalWrites, one for each led.

Thanks for your reply!

Ill read more up on it and see if i can implement what you have given me.

cheers :smiley:

Hi,
Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile: