def eDigitalOut(self, channel, state, idNum = None, demo = 0, writeD=0):
        """
        Name: U12.eDigitalOut(channel, state, idNum = None, demo = 0, writeD=0)
        Args: See section 4.5 of the User's Guide
        Desc: This is a simplified version of DigitalIO that sets/clears the
              state of one digital output. Also configures the requested pin to
              output and leaves it that way.

        >>> import u12
        >>> d = u12.U12()
        >>> d.eDigitalOut(0, 1)
        {idnum': 1}
        """

        # Check id num
        if idNum is None:
            idNum = self.id
        
        if ON_WINDOWS:
            ljid = ctypes.c_long(idNum)
            
            ecode = staticLib.EDigitalOut(ctypes.byref(ljid), demo, channel, writeD, state)
    
            if ecode != 0: raise U12Exception(ecode)
    
            return {"idnum":ljid.value}
        else:
            oldstate = self.rawDIO()
            
            if writeD:
                if channel > 7:
                    channel = channel-8
                    direction = BitField(rawByte = int(oldstate['D15toD8Directions']))
                    direction[7-channel] = 0
                    
                    states = BitField(rawByte = int(oldstate['D15toD8States']))
                    states[7-channel] = state
                    
                    self.rawDIO(D15toD8Directions = direction, D15toD8States = states, UpdateDigital = True)
                    
                else:
                    direction = BitField(rawByte = int(oldstate['D7toD0Directions']))
                    direction[7-channel] = 0
                    
                    states = BitField(rawByte = int(oldstate['D7toD0States']))
                    states[7-channel] = state
                    
                    self.rawDIO(D7toD0Directions = direction, D7toD0States = states, UpdateDigital = True)
                    
            else:
                bf = BitField()
                bf[7-(channel+4)] = 0
                bf[channel-7] = state
                self.rawDIO(IO3toIO0DirectionsAndStates = bf, UpdateDigital = True)
            
            return {"idnum" : self.id}
dataset/ETHPy150Open LabPy/lantz/lantz/drivers/labjack/_internal/u12.py/U12.eDigitalOut/swapped operands of `-`