forked from minetest-mods/mesecons
Little bugfix for programming the microcontroller
This commit is contained in:
parent
686e420430
commit
ce928a5954
|
@ -69,13 +69,9 @@ minetest.register_node(nodename, {
|
||||||
fields.code = "if(A)sbi(1,1); if(!A&B)off(B)sbi(1,0); if(!A&!B)on(B)sbi(1,0); :A is input, B is output (Q), toggles with falling edge"
|
fields.code = "if(A)sbi(1,1); if(!A&B)off(B)sbi(1,0); if(!A&!B)on(B)sbi(1,0); :A is input, B is output (Q), toggles with falling edge"
|
||||||
elseif fields.brsflop then
|
elseif fields.brsflop then
|
||||||
fields.code = "if(A)on(C);if(B)off(C); :A is S (Set), B is R (Reset), C is output (R dominates)"
|
fields.code = "if(A)on(C);if(B)off(C); :A is S (Set), B is R (Reset), C is output (R dominates)"
|
||||||
elseif fields.program then
|
elseif fields.program then --nothing
|
||||||
meta:set_string("infotext", "Programmed Microcontroller")
|
|
||||||
else return nil end
|
else return nil end
|
||||||
|
|
||||||
meta:set_int("heat", 0)
|
|
||||||
yc_reset (pos)
|
|
||||||
update_yc(pos)
|
|
||||||
meta:set_string("code", fields.code)
|
meta:set_string("code", fields.code)
|
||||||
meta:set_string("formspec", "size[9,2.5]"..
|
meta:set_string("formspec", "size[9,2.5]"..
|
||||||
"field[0.256,-0.2;9,2;code;Code:;"..fields.code.."]"..
|
"field[0.256,-0.2;9,2;code;Code:;"..fields.code.."]"..
|
||||||
|
@ -86,6 +82,10 @@ minetest.register_node(nodename, {
|
||||||
"button[6 ,0.2;1.5,3;btflop;T-Flop]"..
|
"button[6 ,0.2;1.5,3;btflop;T-Flop]"..
|
||||||
"button[7.5,0.2;1.5,3;brsflop;RS-Flop]"..
|
"button[7.5,0.2;1.5,3;brsflop;RS-Flop]"..
|
||||||
"button_exit[3.5,1;2,3;program;Program]")
|
"button_exit[3.5,1;2,3;program;Program]")
|
||||||
|
meta:set_string("infotext", "Programmed Microcontroller")
|
||||||
|
meta:set_int("heat", 0)
|
||||||
|
yc_reset (pos)
|
||||||
|
update_yc(pos)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
local rules={}
|
local rules={}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user