I’m not sure if such a thing exists but I’m looking for a switch, well 2 switches actually. Each one a simple SPST but they need to be linked in such a way that only the following is possible:
Both on
Both off
Left on right off
But not Left off right on
Worse case, I could fabricate a tie bar affixed to the bottom of the right switch which pushes the left up when the right moves up but does not move the left down when the right is lowered.
The closest thing I could find are linked circuit breakers which use a tie bar but both always move together.
// Assume PORTB 0:3 used as output 4:7 input
DDRB = 0x0F;
// Set input pullups high
PORTB = 0xF0;
int inputs= 0;
while (1)
{
inputs = PINB >> 4;
_delay_ms(20);
switch (inputs )
{
case 0:
// Both on
PORTB = 3;
break;
case 1:
// Right on, left off
PORTB = 2;
break;
case 3:
// Both off
PORTB = 0;
break;
}
}
I forgot to ask … is there any power available ? Is so, what voltage ?
Without power and w/o mechanical linkages all I can think of is to have the left switch be a DPST and route the right switch output through it. Then if the left switch is off, the right is (effectively) too … though it won’t be obvious by looking at it (the right switch).
lyndon:
What do you think of my idea? At those levels, the relays could be small opto isolators and the entire package could be smaller than some pushbuttons.
THanks lyndon. It's a nice idea but I'd like to keep this as simple as possible.
Mee_n_Mac:
Without power and w/o mechanical linkages all I can think of is to have the left switch be a DPST and route the right switch output through it. Then if the left switch is off, the right is (effectively) too … though it won’t be obvious by looking at it (the right switch).
That's quite a good idea. I'll just be sure to label the switches so that it's clear the right does nothing without the left being on. Thanks.