This is probably very simple, however i'm just missing something.
I have 5 motions sensors. When one of them is tripped, i want to do something different, depending on the sensor... so i need to identify which one was tripped.
I figure that the component address is the way to do that, but i am not getting an address from the signal...
local component = require("component")
local sensor = component.motion_sensor
local event = require("event")
print("Detecting...")
while true do
local _,_,x,y,z,name=event.pull("motion")
print("Detected:",address,name,x,y,z)
end
When i trip any one of the motion sensors, it always gives me 'nil' for the address. the other variables are have valid data.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
ok
This is probably very simple, however i'm just missing something.
I have 5 motions sensors. When one of them is tripped, i want to do something different, depending on the sensor... so i need to identify which one was tripped.
I figure that the component address is the way to do that, but i am not getting an address from the signal...
local component = require("component")
local sensor = component.motion_sensor
local event = require("event")
print("Detecting...")
while true do
local _,_,x,y,z,name=event.pull("motion")
print("Detected:",address,name,x,y,z)
end
When i trip any one of the motion sensors, it always gives me 'nil' for the address. the other variables are have valid data.
probably something simple.. but i'm stuck
any suggestions would be appreciated
Sim
Link to post
Share on other sites