Exemplo n.º 1
0
 /**
  * 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);
   }
 }
Exemplo n.º 2
0
 /**
  * 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);
 }