All exercises

LED Control

Control an LED output based on the logical combination of two push-button inputs.

beginner

Parameters

NameTypeUsageDescription
In_Pb1BOOLInputInput push-button 1
In_Pb2BOOLInputInput push-button 2
Out_LedBOOLOutputLED light output

Behavior

  1. Continuously monitor status of PB1 and PB2.
  2. Set Out_Led to 1 if In_Pb1 is 1 AND In_Pb2 is 0.
  3. Set Out_Led to 0 in all other conditions.

Edge Cases

  • Both PB1 and PB2 are 1.
  • Both PB1 and PB2 are 0.

Constraints

  • Output must update every scan cycle based on input states.

Ready to start?

Open this exercise in Rungs Studio, write your solution, then click Test in the toolbar to verify your work against the built-in test cases.