2 toggle switches and a momentary button, (toggles as settings)

2 toggle switches and a momentary button and 1 led

So I am looking for a tutorial or something to help me figure out a way to code this. Im looking to have settings.

with toggle switch (A) and (B) in the off positions, I push and hold the momentary button the led turns on if I release turns off.

with toggle switch (A) in the on position and the (B) in the off position, I push and hold the momentary button the led flashes at 300 millis when i release turns off

with toggle switch (B) in the on position and the (A) in the off position, I push and hold the momentary button the led flashes at 700 millis. when i release turns off

any help guiding me to some reading material would be great.

Is this homework or does it have a practical application? I am struggling to see one.

The solution is just to use a bunch of if statements.

Grumpy_Mike:
Is this homework or does it have a practical application? I am struggling to see one.

The solution is just to use a bunch of if statements.

Not homework just a project that im working on. it involves an air suspension system and a nextion screen. the settings are for how fast a valve lets air in or out. the valve would be the led in the op. i was just trying to keep the question simple

Look at the boolean operators. As in -

if(switchA and !switchB) LED function here.

You can set up four possibilities with the two switches.

dougp:
Look at the boolean operators. As in -

if(switchA and !switchB) LED function here.

You can set up four possibilities with the two switches.

Thank you ill take a look

Sunday boredom: I wrote code to do that, but won't post until you say you want / need it in the interests of letting you grapple with it if you would prefer to do that.

Grumpy_Mike:
The solution is just to use a bunch of if statements.

.... and BlinkWithOutDelay in a function.

(Nice instructions by the way OP.)

and BlinkWithOutDelay in a function.

No you can do it without that.
Note that the action will depend in each case on holding down the momentary push button then the action will stop when it is released. As no action takes longer than 700mS before the push button can be looked at again, from a human feel point of view you can just use simple delays, and no need for debounce either.