Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Vendor = "Bodnar"
Product = "BU0836X"
Device = 0 -- Multiple devices of the same name need increasing Device numbers.
cwise = 31 --Button number for clockwise turn
ccwise = 30 --Button number for counter-clockwise turn
dev, rd, wrf, wr, init = com.openhid(Vendor, Product, Device, Report)
if dev == 0 then
ipc.log("Could not open HID")
ipc.exit()
end
-- Set the boundary time in milliseconds between
-- "fast" (shorter) and "slow" (longer) signalling
FastTimeLimit = 60 -- Adjust to taste
-- Polling time in milliseconds: should be much shorter than
-- the boundary time
Pollrate = 20 -- same as 50 times per second
-- Initialise variables used to keep track of things
LastTimecwise = 0
LastTimeccwise = 0
Lastcwise = false
Lastccwise = false
-- This function will be called by a time event, set at the end of the program before exit.
function poll(Time)
-- read any data available from the device (only need most recent report)
data, n = com.readlast(dev, rd)
if n ~= 0 then
-- Data was returns, so get the status of two two "buttons" we are using
Thiscwise = com.TestHidButton(dev, cwise, data)
Thisccwise = com.TestHidButton(dev, ccwise, data)
-- See if they've changed since last time
if Thiscwise ~= Lastcwise then
-- Clockwise button changed
-- See if changed in less than the "boundary" time
fast = 0
if (Time - LastTimecwise) < FastTimeLimit then
fast = 1
end
LastTimecwise = Time
-- Toggle a virtual button accordingly
ipc.togglebitsUB(0x3340, 1 + fast) -- Joy 64, Buttons 0 (slow) or 1 (fast)
end
-- Same for counter-clockwise
if Thisccwise ~= Lastccwise then
-- Clockwise button changed
-- See if changed in less than the "boundary" time
fast = 0
if (Time - LastTimeccwise) < FastTimeLimit then
fast = 4
end
LastTimeccwise = Time
-- Toggle a virtual button accordingly
ipc.togglebitsUD(0x3340, 4 + fast) -- Joy 64, Buttons 2 (slow) or 3 (fast)
end
end
end
event.timer(Pollrate, "poll")
Simple: il a choisi l’événement bouger de 5 en 5 (ou 10, je sais plus) de FSX.Je trouve aussi que le cap bouge très vite à chaque pas, étonnant !
Mais comment as tu fais ?
C’est le fameux code Lua pour FSUIPC qui gère l’accélération dont je parlaisCode pour une carte Bodnar pourFSX pour accélérer un encoder
Lua:Vendor = "Bodnar" Product = "BU0836X" Device = 0 -- Multiple devices of the same name need increasing Device numbers. cwise = 31 --Button number for clockwise turn ccwise = 30 --Button number for counter-clockwise turn dev, rd, wrf, wr, init = com.openhid(Vendor, Product, Device, Report) if dev == 0 then ipc.log("Could not open HID") ipc.exit() end -- Set the boundary time in milliseconds between -- "fast" (shorter) and "slow" (longer) signalling FastTimeLimit = 60 -- Adjust to taste -- Polling time in milliseconds: should be much shorter than -- the boundary time Pollrate = 20 -- same as 50 times per second -- Initialise variables used to keep track of things LastTimecwise = 0 LastTimeccwise = 0 Lastcwise = false Lastccwise = false -- This function will be called by a time event, set at the end of the program before exit. function poll(Time) -- read any data available from the device (only need most recent report) data, n = com.readlast(dev, rd) if n ~= 0 then -- Data was returns, so get the status of two two "buttons" we are using Thiscwise = com.TestHidButton(dev, cwise, data) Thisccwise = com.TestHidButton(dev, ccwise, data) -- See if they've changed since last time if Thiscwise ~= Lastcwise then -- Clockwise button changed -- See if changed in less than the "boundary" time fast = 0 if (Time - LastTimecwise) < FastTimeLimit then fast = 1 end LastTimecwise = Time -- Toggle a virtual button accordingly ipc.togglebitsUB(0x3340, 1 + fast) -- Joy 64, Buttons 0 (slow) or 1 (fast) end -- Same for counter-clockwise if Thisccwise ~= Lastccwise then -- Clockwise button changed -- See if changed in less than the "boundary" time fast = 0 if (Time - LastTimeccwise) < FastTimeLimit then fast = 4 end LastTimeccwise = Time -- Toggle a virtual button accordingly ipc.togglebitsUD(0x3340, 4 + fast) -- Joy 64, Buttons 2 (slow) or 3 (fast) end end end event.timer(Pollrate, "poll")
C’est le fameux code Lua pour FSUIPC qui gère l’accélération dont je parlais
Ah un challenge... Ça me plaît ça.Simple: il a choisi l’événement bouger de 5 en 5 (ou 10, je sais plus) de FSX.
Donc le réglage fin du cap à 127 tu oublies…
Comme disent les Anglais « been there, done that »![]()