#!/usr/bin/python # # Small script to test various commands for Logitech FF Wheel # import usb wheel = 0 busses = usb.busses() for bus in busses: devices = bus.devices for dev in devices: if dev.idVendor == 0x046d and dev.idProduct == 0xc29c: print "Found Wheel, testing various settings (press enter to advance to next)" wheel = dev if wheel == 0: print "Wheel not found" exit(0) # Get a device handler for the usb device and detach it from the kernel dh = wheel.open() dh.detachKernelDriver(0) dh.claimInterface(0) print "Clearing previous effect" command = '\xf0\x10\x00\x00\x00\x00\x00' dh.bulkWrite(0x02, command, len(command)) # auto center command = '\x1E\x0D\x03\x03\x40\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Weak Autocentre\n") command = '\x1E\x0D\x06\x06\x80\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Medium Autocentre\n") command = '\x1E\x0D\x07\x07\xff\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Strong Autocentre\n") command = '\x1E\x0D\x00\x00\x00\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("No Autocentre\n") # constant force command = '\x11\x08\x00\x00\x00\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Strong FF_CONSTANT clockwise\n") command = '\x11\x08\x40\x00\x00\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Medium FF_CONSTANT clockwise\n") command = '\x11\x08\x80\x00\x00\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("no FF_CONSTANT\n") command = '\x11\x08\xA0\x00\x00\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Medium FF_CONSTANT counter clockwise\n") command = '\x11\x08\xFF\x00\x00\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Strong FF_CONSTANT counter clockwise\n") # spring force command = '\x11\x11\x80\x80\x33\x00\x40' dh.bulkWrite(0x02, command, len(command)) raw_input("Weak FF_SPRING towards center\n") command = '\x11\x11\x80\x80\x66\x00\x80' dh.bulkWrite(0x02, command, len(command)) raw_input("Medium FF_SPRING towards center\n") command = '\x11\x11\x80\x80\x77\x00\xff' dh.bulkWrite(0x02, command, len(command)) raw_input("Strong FF_SPRING towards center\n") command = '\x11\x11\x60\xA0\x77\x00\xff' dh.bulkWrite(0x02, command, len(command)) raw_input("Strong FF_SPRING towards center, with deadzone\n") # friction force command = '\x11\x12\x03\x00\x03\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Weak FF_FRICTION, resists clockwise movement\n") command = '\x11\x12\x06\x00\x06\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Medium FF_FRICTION, resists clockwise movement\n") command = '\x11\x12\x07\x00\x07\x00\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Strong FF_FRICTION, resists clockwise movement\n") # inertia force command = '\x11\x12\x03\x01\x03\x01\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Weak FF_INERTIA, assists clockwise movement\n") command = '\x11\x12\x06\x01\x06\x01\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Medium FF_INERTIA, assists clockwise movement\n") command = '\x11\x12\x07\x01\x07\x01\x00' dh.bulkWrite(0x02, command, len(command)) raw_input("Strong FF_INERTIA, assists clockwise movement\n") # clean up print "Testing done, clearing previous effect(s)" command = '\xf0\x10\x00\x00\x00\x00\x00' dh.bulkWrite(0x02, command, len(command)) command = '\x1E\x0D\x00\x00\x00\x00\x00' dh.bulkWrite(0x02, command, len(command))