Brain meltdown

Hi everyone

I’ve had a brain meltdown and can’t think of basic things.

What i want to code is a simple switch program.

When button 1 is pressed nothing happens.

When button 1 is pressed then button 2 is pressed output is on.

When button 1 is off and 2 is on nothing happens

When button 1 is pressed and button 2 was still on. Button 2 needs to toggle off then back on for output to turn on.

In my head it should be simple

State machine. I see three states.

The condition of the pushbuttons create the transitions.

Put debouncing at the top of loop.

(I suspect your problem statement is incomplete. It is certainly ambiguous.)

I started with looking back at the state of change code but could figure out the last combination of the switches.

I thought about switch case but got confussed.

Its been a long week

When button 1 is pressed then button 2 is pressed output is on.

Does button 1 have to remain pressed when button 2 becomes pressed ?
What happens when button 1 or button 2 are released ?

If either button 1 or 2 released then output is off

Button 1 must be pressed before button 2 goes from off to on to turn the output on