That is the velocity of 1 axis, when the other axis is in insignificant number, around 1E-6. But I've improved my lua script to automatically get the full velocity, so I don't have to worry about that. First value is the "VI Count" (It's not accurate at all), 2nd and 3rd are the velocities on X and Y axis looking from an overhead view.
al=getAddressList()
vi=addresslist_getMemoryRecord(al,0) --get the first entry in the list
mr=addresslist_getMemoryRecord(al,1) --get the second entry in the list
mr2=addresslist_getMemoryRecord(al,2) --get the third entry in the list
lastValue=memoryrecord_getValue(mr)
lastValue2=memoryrecord_getValue(mr2)
lastVI=memoryrecord_getValue(vi)
print(math.sqrt(math.pow(lastValue,2)+math.pow(lastValue2,2)))
function readValueTimer(t)
local currentValue=memoryrecord_getValue(mr)
local currentValue2=memoryrecord_getValue(mr2)
local currentVI=memoryrecord_getValue(vi)
if currentValue ~= lastValue and tonumber(currentVI) ~= nil and tonumber(currentVI) < 20000 then --value changed
print(math.sqrt(math.pow(currentValue,2)+math.pow(currentValue2,2)))
lastVI=currentVI
lastValue=currentValue
lastValue2=currentValue2
end
end
t1=createTimer(nil)
timer_setInterval(t1,50) --check every 1/200th second if the value has changed
timer_onTimer(t1,readValueTimer)
To stop it:
object_destroy(t1)