Relay

A relay is a circuit operated by an electric current that can be used to remotely switch another circuit. Since it can accept the two values on and off of a switch and requires an action from the control circuit as input, it is a digital actuator.

Makecode

An action/condition can be selected to turn the relay on or off. In the example in the HEX file, the two key events for A and B are used to close the circuit. The write digital value of pin x to 0 block can be found under the advanced pin blocks. The pin must be set to C16 of the A1 connector.