J'essais de faire un petit afficheur 4x4 pixels à base de luacontroller, dont un qui gère tout ceux qui font "affichage".
Voici le code qui devrait bien aller, mais non... :(
Code: Select all
mem.count = 1
-- Frame 1
local ligne_4_frame_1 = {"1", "1", "1", "1"}
local ligne_3_frame_1 = {"1", "1", "1", "1"}
local ligne_2_frame_1 = {"1", "1", "1", "1"}
local ligne_1_frame_1 = {"1", "1", "1", "1"}
-- Frame 2
local ligne_4_frame_2 = {"0", "0", "0", "0"}
local ligne_3_frame_2 = {"0", "0", "0", "0"}
local ligne_2_frame_2 = {"0", "0", "0", "0"}
local ligne_1_frame_2 = {"0", "0", "0", "0"}
-- Frame 3
local ligne_4_frame_3 = {"1", "0", "0", "0"}
local ligne_3_frame_3 = {"1", "0", "0", "0"}
local ligne_2_frame_3 = {"1", "0", "0", "0"}
local ligne_1_frame_3 = {"1", "0", "0", "0"}
-- Frame 4
local ligne_4_frame_4 = {"0", "1", "0", "0"}
local ligne_3_frame_4 = {"0", "1", "0", "0"}
local ligne_2_frame_4 = {"0", "1", "0", "0"}
local ligne_1_frame_4 = {"0", "1", "0", "0"}
-- Frame 5
local ligne_4_frame_5 = {"0", "0", "1", "0"}
local ligne_3_frame_5 = {"0", "0", "1", "0"}
local ligne_2_frame_5 = {"0", "0", "1", "0"}
local ligne_1_frame_5 = {"0", "0", "1", "0"}
-- Frame 6
local ligne_4_frame_6 = {"0", "0", "0", "1"}
local ligne_3_frame_6 = {"0", "0", "0", "1"}
local ligne_2_frame_6 = {"0", "0", "0", "1"}
local ligne_1_frame_6 = {"0", "0", "0", "1"}
-- Frame 7
local ligne_4_frame_7 = {"0", "0", "0", "0"}
local ligne_3_frame_7 = {"0", "0", "0", "0"}
local ligne_2_frame_7 = {"0", "0", "0", "0"}
local ligne_1_frame_7 = {"0", "0", "0", "0"}
if event.type == "digiline" and event.channel == "master" then
local iid="run"
if mem.count == nil then
mem.count = 1
end
print("mem.count = "..mem.count)
i = mem.count
msg = (ligne_1_frame_[i])
--print("msg = "..msg)
--digiline_send("lua_1", ligne_1_frame_[mem.count])
--digiline_send("lua_2", ligne_2_frame_[mem.count])
--digiline_send("lua_3", ligne_3_frame_[mem.count])
--digiline_send("lua_4", ligne_4_frame_[mem.count])
mem.count = mem.count+1
print("mem.count+1 = "..mem.count)
iid = "stop"
interrupt(1, iid)
end
Code: Select all
023-05-01 11:30:11: ACTION[Server]: Lua controller programming error: (load):54: attempt to index global 'ligne_1_frame_' (a nil value)
Merci à celles et ceux qu'y m'ont lu et à aux autres qui m'apporteront un début de réponse.
Cordialement...