add io brick, misc fixes
This commit is contained in:
12
bricks/inputs/iobrick-input.lua
Normal file
12
bricks/inputs/iobrick-input.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
return function(gate, argv)
|
||||
local arg = argv[1]
|
||||
for i = 1, #arg, 2 do
|
||||
local d = arg:sub(i, i+1)
|
||||
local v = tonumber(d, 16) or 0
|
||||
if #gate.queueIn < 2048 then
|
||||
table.insert(gate.queueIn, 1, v)
|
||||
end
|
||||
end
|
||||
Gate.queue(gate, 0)
|
||||
end
|
||||
Reference in New Issue
Block a user