← All exercises

Lamp Inverted

easy

Turn off a lamp while a push button is pressed and on when released.

What it teaches

Flip the input. When the button is on, the lamp is off; when the button is off, the lamp is on.

Inputs and outputs

TagTypeDefaultDescription
In_ButtonBOOLPush button input
Out_LampBOOLLamp drive signal

Required behavior

  • The lamp output is ON (1) when the push button input is OFF (0).
  • The lamp output is OFF (0) when the push button input is ON (1).