Posted 14 October 2012 - 02:39 AM
Hi i followed this guide - http://www.youtube.com/watch?v=34R4KfLmMSY
But when i try to use getSensorReadingAsDict(side,sensor,target,probe,…)
It returns nothing
my messy code:
But when i try to use getSensorReadingAsDict(side,sensor,target,probe,…)
It returns nothing
my messy code:
function printDict(data)
for i,v in pairs(data) do
print(tostring(i).." - "..tostring(v))
end
end
ctrl = sensors.getController()
-- print(ctrl)
data = sensors.getSensors(ctrl)
-- printDict(data)
motorOneSensor = data[1];
data = sensors.getSensorInfo(ctrl,motorOneSensor)
-- printDict(data)
data = sensors.getProbes(ctrl,motorOneSensor)
-- printDict(data)
combustionMotorOneProbe = data[5]
sensors.setTarget(ctrl,motorOneSensor,combustionMotorOneProbe)
data = sensors.getAvailableTargetsforProbe(ctrl,motorOneSensor,combustionMotorOneProbe)
-- printDict(data)
motorOneTarget = data[1]
data = sensors.getSensorReadingAsDict(ctrl,motorOneSensor,motorOneTarget,combustionMotorOneProbe)
printDict(data)