Micro controller programming. (my erorrs in it) in Programming Posted August 19, 2017 I am not very versed in that kind of programming, but I managed to write the following code so far: local modem=component.proxy(component.list("modem")()) local turbine=component.proxy(component.list("br_turbine")()) modem.open(1) local target = false while true do local e, to, from, _, _, command = computer.pullSignal() if e == "modem_message" then if command == "s" then modem.send(from,1, "Handshake") local target = from elseif command == "a" then if (turbine.getActive()) then turbine.setActive(false) else turbine.setActive(true) end elseif command == "c" then if (turbine.getInductorEngaged()) then turbine.setInductorEngaged(false) else turbine.setInductorEngaged(true) end elseif (target) then local data1 = tostring(turbine.getActive()) local data2 = tostring(turbine.setInductorEngaged()) local data3 = tostring(turbine.getRotorSpeed()) modem.send(target,1, data1, data2, data3) end end end But if I try to run it I only get the error message: Quote bad argument #1 (string expected, got nil) and I haven't a clue what did I wrong where.
Micro controller programming. (my erorrs in it)
in Programming
Posted
I am not very versed in that kind of programming,
but I managed to write the following code so far:
But if I try to run it I only get the error message:
and I haven't a clue what did I wrong where.