playing with the Mesecons mod. I have the micro-controller with lamps connected to ports B/D and switches to A/C.
I'd like the lamps to come on when a switch (A) is turned on.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
port = {a=false, b=false, c=false, d=false}
if port.a == true then
port.b = true
port.d = true
else
port.b = false
port.d = false
end
I'm not sure if there's something wrong with my code, but I sense I haven't done anything to detect the switch being activated.
I'd appreciate any advice.