PollVelocity attempt 1
This commit is contained in:
8
main.lua
8
main.lua
@@ -414,13 +414,13 @@ function PollSensors()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function PollVelocity()
|
function PollVelocity()
|
||||||
local velSensors = peripheral.find("velocity_sensor")
|
local velSensors = { peripheral.find("velocity_sensor") }
|
||||||
|
|
||||||
-- Velocity Sensors
|
-- Velocity Sensors
|
||||||
VelocityVectors = {}
|
VelocityVectors = {}
|
||||||
for vi, vs in pairs(velSensors) do
|
for vsindex, velsensor in pairs(velSensors) do
|
||||||
local vsAxis = vs.getAxis()
|
local vsAxis = velsensor.getAxis()
|
||||||
local vsVelocity = vs.getVelocity()
|
local vsVelocity = velsensor.getVelocity()
|
||||||
VelocityVectors[vsAxis] = vsVelocity
|
VelocityVectors[vsAxis] = vsVelocity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user