So if my program is named door.lua and it's located in /home, I would do...
Edit /etc/rc.d -> enabled = {} -> enabled = {"door.lua"}
Is that correct? If so it's not working, so I must have done something wrong.
I replaced io.read() with event.pull() and now the motion sensor works perfectly. Though now I can't enter anything to open the door, so clearly I used the wrong call, right?
hmm, then maybe the sensitivity is too low? How can I change that?
The sensitivity is fine actually. I don't know what's up with it. I ran it as it's own script and it worked (mind you it didn't keep a solid redstone output, so the piston kept moving.) so maybe it has something to do with how I structured it. Is it my "While true do"?
I have this script that I wrote to control a piston door via redstone and on the other side of the door I have a motion sensor to open the piston door (toggle the redstone signal on). For some reason the motion sensor isn't doing anything, though. I know it's something I did, I'm new to LUA.
local component = require("component")
local sides = require("sides")
local event = require("event")
local gpu = component.gpu
local term = require("term")
local rs = component.redstone
-- Config
local delay = 5
while true do
-- GUI
term.clear()
gpu.setForeground(0x00FF00)
print("---