(self, left_motor, right_motor)
Control the speed of both motors seperately
Control the speed of both motors seperately
Control the speed of both motors seperately
def set_vibration(self, left_motor, right_motor):
        "Control the speed of both motors seperately"
        # Set up function argument types and return type
        XInputSetState = xinput.XInputSetState
        XInputSetState.argtypes = [ctypes.c_uint, ctypes.POINTER(XINPUT_VIBRATION)]
        XInputSetState.restype = ctypes.c_uint

        vibration = XINPUT_VIBRATION(
            int(left_motor * 65535), int(right_motor * 65535))
        XInputSetState(self.device_number, ctypes.byref(vibration))
def set_vibration ( self , left_motor , right_motor ) : # Set up function argument types and return type XInputSetState = xinput . XInputSetState XInputSetState . argtypes = [ ctypes . c_uint , ctypes . POINTER ( XINPUT_VIBRATION ) ] XInputSetState . restype = ctypes . c_uint vibration = XINPUT_VIBRATION ( int ( left_motor * 65535 ) , int ( right_motor * 65535 ) ) XInputSetState ( self . device_number , ctypes . byref ( vibration ) )