public virtual void setPinDigitalOut(int pin, bool value, DigitalOutputSpecMode mode) { LOG.Debug("Sending SET_PIN_DIGITAL_OUT"); beginBatch(); writeByte((byte)IOIOProtocolCommands.SET_PIN_DIGITAL_OUT); writeByte((pin << 2) | (mode == DigitalOutputSpecMode.OPEN_DRAIN ? 0x01 : 0x00) | (value ? 0x02 : 0x00)); endBatch(); }
/** * Constructor. * * @param Pin * Pin number, as labeled on the board. * @param mode * Pin mode. */ public DigitalOutputSpec(int pin, DigitalOutputSpecMode mode) { this.Pin = pin; this.Mode = mode; }