def __init__(self,serialNumber=-1,exclusive=0,threaded=1):
     """
     @param serialNumber: the unique serial number of the board to connect to.
         -1 will choose the first available board. default is first available.
     @param exclusive: if true, request exclusive access to this device so that
         no other program can connect to it. default is non-exclusive.
     @param threaded: if true, this class will start a thread to call the read()
         function so that you don't need to call it yourself. default is to
         use the read thread. You probably don't want to change this.
         
     @raise phidgets.error: if there are no available devices of this type, this
         serial number doesn't exist, if exclusive access can't be granted, or
         if a device is already in use by another program with exclusive access.
     """
     Phidget.__init__(self)
     self.ptr = cphidgets.InterfaceKit_open(serialNumber,exclusive)
     
     if (threaded):
         cphidgets.InterfaceKit_startReadThread(self.ptr)
Beispiel #2
0
    def __init__(self, serialNumber=-1, exclusive=0, threaded=1):
        """
        @param serialNumber: the unique serial number of the board to connect to.
            -1 will choose the first available board. default is first available.
        @param exclusive: if true, request exclusive access to this device so that
            no other program can connect to it. default is non-exclusive.
        @param threaded: if true, this class will start a thread to call the read()
            function so that you don't need to call it yourself. default is to
            use the read thread. You probably don't want to change this.
            
        @raise phidgets.error: if there are no available devices of this type, this
            serial number doesn't exist, if exclusive access can't be granted, or
            if a device is already in use by another program with exclusive access.
        """
        Phidget.__init__(self)
        self.ptr = cphidgets.Accelerometer_open(serialNumber, exclusive)

        if (threaded):
            cphidgets.Accelerometer_startReadThread(self.ptr)
 def __del__(self):
     self.close()
     Phidget.__del__(self)
Beispiel #4
0
 def __del__(self):
     self.close()
     Phidget.__del__(self)