Single shot

Pseudo example:

byte latch = 0; //initial variable
If(switch == HIGH) { //looks at the switch, if it is high for the first time, LED is ON. If the switch changes then goes high again, LED is OFF

!latch; // This detects whether the switch changed or not.

latch ? (do this if TRUE) : (do this if FALSE); //conditional statement, compressed IF/ELSE statement
}