"Directional Switch" Design

Something like this

Apply power with the drawer open, the light will come on because both FFs are set by the RC circuit.

1/2 close drawer, FF1 gets clocked with 1 on D, light stays on. FF2 changes state.

Drawer closed, FF1 gets reset, light off.

Open drawer, at 1/2 pos FF1 is clocked but has 0 on D so no light. Also FF2 changes state.

Close drawer, at 1/2 position FF1 gets clocked with 1 on D, light stays on. FF2 changes state.

Drawer closed, FF1 gets reset, light off.

etc etc.

I think that's about right although my brain hurts when I do this stuff and I often get my levels arse about face.

The 1/2 closed switch should provide a positive level and MUST be debounced, the closed switch input should provide a low level and doesn't need to be debounced.


Rob