local event = require("event")
local component = require("component")
keypad = component.os_keypad
keypad.setEventName("eventName")
keypad.setDisplay("DoorCode")
customButtons = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "X", "0", ">"}
keypad.setKey(customButtons, customButtonColor)
--local event, address, button, button_label = event.pull("keypad") -- I'm stuck here
while true do
if keypad == "1" then
print("1")
if keypad == "2" then
print("2")
if keypad == "1" then
print("3")
if keypad == "1" then
print("4")
print("Password correct!")
elseif keypad == "1" then
print("not 1")
end
elseif keypad == "2" then
print("not 2")
end
elseif keypad == "3" then
print("not 3")
end
elseif keypad == "4" then
print("not 4")
end
end
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.
So i'm trying to make a "password" for a door with the keypad from OpenSecurity
For more info about the Keypad: https://github.com/PC-Logix/OpenSecurity/wiki/Blocks#events-1
The code i got before getting stuck
Link to post
Share on other sites