Pressure sensor LED flash

I am a beginner in Arduino code and set up however i need to design a system where;

When a pressure sensor is activated for 0-20 seconds a green LED - HIGH
When a pressure sensor is activated for 0-20 seconds a amber LED - LOW
When a pressure sensor is activated for 0-20 seconds a red LED - LOW

When a pressure sensor is activated for 20-30 seconds a green LED - LOW
When a pressure sensor is activated for 20-30 seconds a amber LED - HIGH
When a pressure sensor is activated for 20-30 seconds a red LED - LOW

When a pressure sensor is activated for 30-40 seconds a green LED - LOW
When a pressure sensor is activated for 30-40 seconds a amber LED - LOW
When a pressure sensor is activated for 30-40 seconds a red LED - HIGH

can anyone help with how this sketch might read?

Do you have anything?
Can you read this pressure sensor, switch on and off LEDs?

Hello and welcome to the forum! I think this project is a good way to get your feet wet with Arduino programming. I think you should follow this thread all the way through until your project's completion.

I think you should first start off by figuring out how to blink one LED. And then, learn to blink more than one. And then, we will go from there.

Try to see if you can follow this tutorial:
https://www.arduino.cc/en/tutorial/blink

Once you can get LEDs blinking, report back here so we can help you through the rest of the project. Don't hesitate to ask more questions if you are stuck on blinking the LED.

Hi,
Is you pressure sensor a switch or pressure level sensor.
Can you post spec/data link for it please?

Thanks.. Tom.. :slight_smile:

perkinsa:
I am a beginner in Arduino code and set up however i need to design a system where;

When a pressure sensor is activated for 0-20 seconds a green LED - HIGH
When a pressure sensor is activated for 0-20 seconds a amber LED - LOW
When a pressure sensor is activated for 0-20 seconds a red LED - LOW

When a pressure sensor is activated for 20-30 seconds a green LED - LOW
When a pressure sensor is activated for 20-30 seconds a amber LED - HIGH
When a pressure sensor is activated for 20-30 seconds a red LED - LOW

When a pressure sensor is activated for 30-40 seconds a green LED - LOW
When a pressure sensor is activated for 30-40 seconds a amber LED - LOW
When a pressure sensor is activated for 30-40 seconds a red LED - HIGH

can anyone help with how this sketch might read?

I re-read this to make sure I did not miss anything.
if you have 'a' 'one' 'single' pressure sensor and when it is on fully (like a switch)
then the three LEDs will turn on
up to 20 seconds, the GREEN goes HIGH, AMBER goes LOW, RED goes LOW
after 20 seconds, the GREEN goes LOW, AMBER goes HIGH, RED goes LOW
after 30 seconds, the GREEN stay LOW, AMBER goes LOW, RED goes HIGH

Can you post your full assignment ?
when is it due ?
what type of sketchs have you done ?
are familiar with the tutorial sketch - blink without delay ?