/** * Turns the relay off and prevents it from being turned on. * * @return if module was successfully disabled */ public final boolean disable() { super.set(OFF); return !(enabled = false); }
/** * If the module is enabled, sets the relay state. * * <p>Valid values depend on which directions of the relay are controlled by the object. * * <p>When set to kBothDirections, the relay can be set to any of the four states: 0v-0v, 12v-0v, * 0v-12v, 12v-12v. * * <p>When set to forwards only or reverse only, you can specify the constant for the direction or * you can simply specify off and on. Using only off and on is recommended. * * @param value the state to set the relay */ public final void set(Value value) { if (isEnabled()) { super.set(value); } }
/** * Turns the output on or off. This uses the last set direction, and turns the spike on or off in * that direction. Is virtually identical to calling {@code set(SpikeRelay.ON)} or {@code * set(SpikeRelay.OFF)}. * * @param on whether spike should be on */ public final void set(boolean on) { set(on ? ON : OFF); }