Re: [Mod] Digilines [minetest-mod-digilines]
Posted: Thu Mar 03, 2016 16:58
You can't make a terminal using minetest without the ability to send key presses, terminals aren't just typing commands.
The official Minetest discussion board
https://forum.minetest.net/
Code: Select all
2017-12-27 15:05:31: WARNING[Server]: ServerEnv: Trying to store id = 2770 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:33: WARNING[Server]: ServerEnv: Trying to store id = 2775 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:33: WARNING[Server]: ServerEnv: Trying to store id = 2774 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:34: ERROR[Server]: Server::ProcessData(): Canceling: No player for peer_id=3 disconnecting peer!
2017-12-27 15:05:35: WARNING[Server]: ServerEnv: Trying to store id = 2779 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:35: WARNING[Server]: ServerEnv: Trying to store id = 2778 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:37: WARNING[Server]: ServerEnv: Trying to store id = 2783 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:37: WARNING[Server]: ServerEnv: Trying to store id = 2782 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:39: WARNING[Server]: ServerEnv: Trying to store id = 2787 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:39: WARNING[Server]: ServerEnv: Trying to store id = 2786 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:39: WARNING[Server]: ServerEnv: Trying to store id = 2785 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:39: WARNING[Server]: ServerEnv: Trying to store id = 2784 statically but block (645,0,-610) already contains 100 objects. Forcing delete.
2017-12-27 15:05:41: ERROR[Server]: ServerEnvironment::deactivateFarObjects(): id=2791 m_static_exists=true but static data doesn't actually exist in (645,0,-610)
2017-12-27 15:05:41: WARNING[Server]: StaticObjectList::remove(): id=2791 not found
2017-12-27 15:05:41: WARNING[Server]: ServerEnv: Trying to store id = 2791 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
2017-12-27 15:05:41: ERROR[Server]: ServerEnvironment::deactivateFarObjects(): id=2790 m_static_exists=true but static data doesn't actually exist in (645,0,-610)
2017-12-27 15:05:41: WARNING[Server]: StaticObjectList::remove(): id=2790 not found
2017-12-27 15:05:41: WARNING[Server]: ServerEnv: Trying to store id = 2790 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
2017-12-27 15:05:41: ERROR[Server]: ServerEnvironment::deactivateFarObjects(): id=2789 m_static_exists=true but static data doesn't actually exist in (645,0,-610)
2017-12-27 15:05:41: WARNING[Server]: StaticObjectList::remove(): id=2789 not found
2017-12-27 15:05:41: WARNING[Server]: ServerEnv: Trying to store id = 2789 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
2017-12-27 15:05:41: ERROR[Server]: ServerEnvironment::deactivateFarObjects(): id=2788 m_static_exists=true but static data doesn't actually exist in (645,0,-610)
2017-12-27 15:05:41: WARNING[Server]: StaticObjectList::remove(): id=2788 not found
2017-12-27 15:05:41: WARNING[Server]: ServerEnv: Trying to store id = 2788 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
2017-12-27 15:05:43: WARNING[Server]: ServerEnv: Trying to store id = 2793 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
2017-12-27 15:05:43: WARNING[Server]: ServerEnv: Trying to store id = 2792 statically but block (645,0,-610) already contains 104 objects. Forcing delete.
Code: Select all
digiline_send("LCD", "Hello, World!")
Code: Select all
(load):1: attempt to call global 'digiline_send' (a nil value)
Ismoor wrote:I connected a luacontroller with digilines to a LCD, a RTC and a lightsensor and used the following to test the LCD:But I get the following error in the editor:Code: Select all
digiline_send("LCD", "Hello, World!")
What's wrong?Code: Select all
(load):1: attempt to call global 'digiline_send' (a nil value)
*EDIT:*
I pulled mesecons from the github master branch, which seems to have problems with my configuration.
With the 2017.03.05 Release package all is well, so problem solved.
Code: Select all
local function get_digiline_send(pos, itbl, send_warning)
if not minetest.global_exists("digilines") then return end
[...]
Code: Select all
digilines = {}
[...]
Code: Select all
if not digiline then return end
Ask here: viewtopic.php?t=20651Miniontoby wrote:Can you check the status of the led marque?
Code: Select all
-- time to screen script
if event.channel == "t" then
if event.msg == "1" then
digiline_send("1","allon")
elseif event.msg == "2" then
digiline_send("2","allon")
elseif event.msg == "3" then
digiline_send("3","allon")
elseif event.msg == "4" then
digiline_send("4","allon")
elseif event.msg == "5" then
digiline_send("5","allon")
elseif event.msg == "6" then
digiline_send("6","allon")
elseif event.msg == "7" then
digiline_send("7","allon")
elseif event.msg == "8" then
digiline_send("8","allon")
elseif event.msg == "9" then
digiline_send("9","allon")
elseif event.msg == "10" then
digiline_send("10","allon")
elseif event.msg == "11" then
digiline_send("11","allon")
elseif event.msg == "12" then
digiline_send("12","allon")
elseif event.msg == "13" then
digiline_send("1","allon")
elseif event.msg == "14" then
digiline_send("2","allon")
elseif event.msg == "15" then
digiline_send("3","allon")
elseif event.msg == "16" then
digiline_send("4","allon")
elseif event.msg == "17" then
digiline_send("5","allon")
elseif event.msg == "18" then
digiline_send("6","allon")
elseif event.msg == "19" then
digiline_send("7","allon")
elseif event.msg == "20" then
digiline_send("8","allon")
elseif event.msg == "21" then
digiline_send("9","allon")
elseif event.msg == "22" then
digiline_send("10","allon")
elseif event.msg == "23" then
digiline_send("11","allon")
elseif event.msg == "24" then
digiline_send("12","allon")
end
end
-- Clock (RTC) output to hour and minute script
if event.channel == "clock" then
time = event.msg * 24
hour = math.floor(time)
time = (time % 1) * 60
minute = math.floor(time)
digiline_send("hour", hour)
digiline_send("t", hour)
digiline_send("minute", minute)
end
You can probably reduce that code into a simplified form as follows (which should also help with the controller burning:Miniontoby wrote:I try to make a working analog clock in minetest with digilines, digistuff and led marquee (led marquee isn't the problem) but it doesn't work
If you would like to see the design, what there is happening and what I did tried in 25 minutes watch the video
https://drive.google.com/file/d/1ZVdk33 ... sp=sharing
Here is the codePlease help meCode: Select all
-- time to screen script if event.channel == "t" then if event.msg == "1" then digiline_send("1","allon") elseif event.msg == "2" then digiline_send("2","allon") elseif event.msg == "3" then digiline_send("3","allon") elseif event.msg == "4" then digiline_send("4","allon") elseif event.msg == "5" then digiline_send("5","allon") elseif event.msg == "6" then digiline_send("6","allon") elseif event.msg == "7" then digiline_send("7","allon") elseif event.msg == "8" then digiline_send("8","allon") elseif event.msg == "9" then digiline_send("9","allon") elseif event.msg == "10" then digiline_send("10","allon") elseif event.msg == "11" then digiline_send("11","allon") elseif event.msg == "12" then digiline_send("12","allon") elseif event.msg == "13" then digiline_send("1","allon") elseif event.msg == "14" then digiline_send("2","allon") elseif event.msg == "15" then digiline_send("3","allon") elseif event.msg == "16" then digiline_send("4","allon") elseif event.msg == "17" then digiline_send("5","allon") elseif event.msg == "18" then digiline_send("6","allon") elseif event.msg == "19" then digiline_send("7","allon") elseif event.msg == "20" then digiline_send("8","allon") elseif event.msg == "21" then digiline_send("9","allon") elseif event.msg == "22" then digiline_send("10","allon") elseif event.msg == "23" then digiline_send("11","allon") elseif event.msg == "24" then digiline_send("12","allon") end end -- Clock (RTC) output to hour and minute script if event.channel == "clock" then time = event.msg * 24 hour = math.floor(time) time = (time % 1) * 60 minute = math.floor(time) digiline_send("hour", hour) digiline_send("t", hour) digiline_send("minute", minute) end
Code: Select all
-- time to screen script
local HOUR_CHANNEL = "hour"
local MINUTE_CHANNEL = "minute"
local ALLON = "allon"
local function init_mem()
if mem.hour == nil then mem.hour=0 end
if mem.minute == nil then mem.minute=0 end
end
local function send_hour()
-- the channel for this is the hour "1", "2", etc
digiline_send(tostring(mem.hour),ALLON)
-- this just sends the hour
digiline_send(HOUR_CHANNEL,tostring(mem.hour)
end
local function send_minute()
digiline_send(MINUTE_CHANNEL,tostring(mem.minute))
end
-- initialize memory varibles (they will be created and remain until controller is burned or dug)
init_mem()
if event.type == "digiline"
if event.channel ~= "clock" then
return -- no need to continue executing this script, on the wrong channel
end
if event.channel == "clock" then
-- Clock (RTC) output to hour and minute script
local old_hour = mem.hour
local old_minute = mem.minute
local new_time = tonumber(event.msg) * 24
-- hour is 0 to 11 (1 to 12)
mem.hour = (math.floor(new_time) % 12) + 1
-- minute is the remainder * 60
mem.minute = math.floor((new_time % 1) * 60 )
-- only need to call digiline_send once to set the value, as it will remain on the end-point device until it is changed again.
if old_hour ~= hour then
send_hour() -- send only if hour has changed
end
if old_minute ~= minute then
send_minute() -- send only if minute has changed
end
end
end
Code: Select all
-- time to screen script
local HOUR_CHANNEL = "hour"
local MINUTE_CHANNEL = "minute"
local ALLON = "allon"
local function init_mem()
if mem.hour == nil then mem.hour=0 end
if mem.minute == nil then mem.minute=0 end
end
local function send_hour()
-- the channel for this is the hour "1", "2", etc
digiline_send(tostring(mem.hour),ALLON)
-- this just sends the hour
digiline_send(HOUR_CHANNEL,tostring(mem.hour))
end
local function send_minute()
digiline_send(MINUTE_CHANNEL,tostring(mem.minute))
end
-- initialize memory varibles (they will be created and remain until controller is burned or dug)
init_mem()
if event.type == "digiline" then
if event.channel ~= "clock" then
return -- no need to continue executing this script, on the wrong channel
end
if event.channel == "clock" then
-- Clock (RTC) output to hour and minute script
local old_hour = mem.hour
local old_minute = mem.minute
local new_time = tonumber(event.msg) * 24
-- hour is 0 to 11 (1 to 12)
mem.hour = (math.floor(new_time) % 12) + 1
-- minute is the remainder * 60
mem.minute = math.floor((new_time % 1) * 60 )
-- only need to call digiline_send once to set the value, as it will remain on the end-point device until it is changed again.
if old_hour ~= hour then
send_hour() -- send only if hour has changed
end
if old_minute ~= minute then
send_minute() -- send only if minute has changed
end
end
end
need add clear cmdMiniontoby wrote:I try to make a working analog clock in minetest with digilines, digistuff and led marquee (led marquee isn't the problem) but it doesn't work
If you would like to see the design, what there is happening and what I did tried in 25 minutes watch the video
https://drive.google.com/file/d/1ZVdk33 ... sp=sharing
Here is the codePlease help meCode: Select all
-- time to screen script if event.channel == "t" then if event.msg == "1" then digiline_send("allon", "clear") digiline_send("allon","1") elseif event.msg == "2" then digiline_send("allon", "clear") digiline_send("allon","2") elseif event.msg == "3" then digiline_send("allon", "clear") digiline_send("allon","3") elseif ............
Code: Select all
if event.type == "on" then
digiline_send("clock", "GET")
end
Code: Select all
if event.channel == "clock" then
time = event.msg * 24
hour = math.floor(time)
tenhour, hour = math.floor(hour / 10), hour % 10
time = (time % 1) * 60
minute = math.floor(time)
tenminute, minute = math.floor(minute / 10), minute % 10
digiline_send("lop", tenhour)
digiline_send("pol", hour)
digiline_send("olp", tenminute)
digiline_send("plo", minute)
end
__1__ The blinky-plant overheat the lua-controllerulla wrote:need add clear cmdMiniontoby wrote:I try to make a working analog clock in minetest with digilines, digistuff and led marquee (led marquee isn't the problem) but it doesn't work
If you would like to see the design, what there is happening and what I did tried in 25 minutes watch the video
https://drive.google.com/file/d/1ZVdk33 ... sp=sharing
Here is the codePlease help meCode: Select all
-- time to screen script if event.channel == "t" then if event.msg == "1" then digiline_send("allon", "clear") digiline_send("allon","1") elseif event.msg == "2" then digiline_send("allon", "clear") digiline_send("allon","2") elseif event.msg == "3" then digiline_send("allon", "clear") digiline_send("allon","3") elseif ............
but is better in this mode
- __1 __put
in luacontroller and connect one blinky_plantCode: Select all
if event.type == "on" then digiline_send("clock", "GET") end
__2__ connect rtc and assign "clock" how channel
__3__ connect rtc whit one other lua controller and put this :__4__connect the luacontroller whit 4 led or 4 lcd and assign channel lop pol olp plo and workCode: Select all
if event.channel == "clock" then time = event.msg * 24 hour = math.floor(time) tenhour, hour = math.floor(hour / 10), hour % 10 time = (time % 1) * 60 minute = math.floor(time) tenminute, minute = math.floor(minute / 10), minute % 10 digiline_send("lop", tenhour) digiline_send("pol", hour) digiline_send("olp", tenminute) digiline_send("plo", minute) end
if use 4 led connect from last to first if you place them near