Hi everyone, I'm having a bit of trouble working out the code for my practice testing. I'm new to anything to do with electronics and programming (1 month with Arduino now) so please make things as simple for me to understand. Thank you!
What i'm trying to do is have 3 leds that react to the force on a force sensor. Eg, if I hit the sensor and it shows 900 reading, I want an led to glow red for 10 seconds and then go back to having no Leds on. If I hit it with a 200 reading, I want a yellow led to light up for 10 seconds and so on.
The attachments show my current circuitry and arduino codes, please help me learn and get to what I'm trying to achieve. It is not currently working for me.
Thanks so much!
Force_sensor_turns_different_led_on.ino (2.24 KB)
The leds still work in other codes, they just aren't working in this one. When I run the code and hit the sensor, none of the leds light up, sometimes one of them will randomly light up.
I need to put resistors into the circuit, I don't understand where.
Also, in the serial monitor, when I touch the resistor, the reading goes to 0.
Just an update:
Is this more like the code suggests? I now have the lights turning on depending how hard the sensor is hit.
Is there a way in the code to make the force needed to turn the red led on much greater, as right now I have it set to above 1000 sensorValue but it only takes a small tap to make the red on turn on still, while I have to try really hard to tap light enough to get the other two led colours.
The image of the current wiring is in the attachment:
Thanks again guys
![IMAG0058[1].jpg](https://europe1.discourse-cdn.com/arduino/original/3X/8/e/8e64a2eca5e6d4d87cbcf245ea0f00bf137e2a89.jpg)
Hi,
I notice that the protboard you are using has its blue and red side conductors open circuit in the middle, you will have to jumper the breaks to get power and gnd to all of your circuit.
Tom... 

Thanks Tom for your input!