Code: Select all
setTickRate(20)
icrId = addChannel("ICR",10,2)
function onTick()
# Convert the GPS Speed to meters per second
mps = ((getGpsSpeed()*0.44704))
# Prevent a divide by zero
if mps >=0.05 then
icr = (getImu(1)*9.806)/(mps*mps)
else
icr=0.0
end
setChannel(icrId,icr)
if getGpio(0) == 1 then
startLogging()
else
stopLogging()
end
end
What I get is either almost entirely all zero's or no readings. Any thoughts?[/code]