add test
This commit is contained in:
parent
f8de4e500c
commit
cfe1de55ae
1 changed files with 4 additions and 2 deletions
4
test.py
4
test.py
|
@ -1,6 +1,7 @@
|
||||||
import pyiforce as ifr
|
import pyiforce as ifr
|
||||||
import serial
|
import serial
|
||||||
import pyvjoy
|
import pyvjoy
|
||||||
|
import pyvjoy_ffb as ffb
|
||||||
|
|
||||||
PORT = 'COM7'
|
PORT = 'COM7'
|
||||||
BAUD = 38400
|
BAUD = 38400
|
||||||
|
@ -48,6 +49,7 @@ with serial.Serial(port=PORT, baudrate=BAUD) as port:
|
||||||
setup_wheel(port)
|
setup_wheel(port)
|
||||||
|
|
||||||
j = pyvjoy.VJoyDevice(1)
|
j = pyvjoy.VJoyDevice(1)
|
||||||
|
ffb.add_ffb(j)
|
||||||
|
|
||||||
|
|
||||||
# def handle_wheel(w):
|
# def handle_wheel(w):
|
||||||
|
@ -70,7 +72,7 @@ with serial.Serial(port=PORT, baudrate=BAUD) as port:
|
||||||
# j.update()
|
# j.update()
|
||||||
|
|
||||||
# ifr.set_handler(ifr.Packet.INPUT_WHEEL, handle_wheel)
|
# ifr.set_handler(ifr.Packet.INPUT_WHEEL, handle_wheel)
|
||||||
ifr.set_handler(ifr.Packet.INPUT_WHEEL, print)
|
# ifr.set_handler(ifr.Packet.INPUT_WHEEL, print)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
ifr.rx_pump()
|
ifr.rx_pump()
|
||||||
|
|
Loading…
Reference in a new issue