Posted 26 December 2012 - 07:01 AM
hi,
I tried searching for the answer, and didn't find it, how do you call a program on a peripheral?
For example, say I want to have a master turtle walk on top of a set of slave turtles and run a program on all slave turtles.
I want to do the equivalent of typing out these two commands:
"rom/programs/read-image/bmt 00"
"rom/programs/read-image/bmt 01"
local numTurtles = 2
for turtleNumber=1,numTurtles do
local montageNumber = string.format("%02d", turtleNumber-1)
turtle.forward();
peripheral.call("bottom", "turnOn")
peripheral.call("bottom", "os.run", "rom/programs/read-image/bmt", montageNumber)
end
I tried searching for the answer, and didn't find it, how do you call a program on a peripheral?
For example, say I want to have a master turtle walk on top of a set of slave turtles and run a program on all slave turtles.
I want to do the equivalent of typing out these two commands:
"rom/programs/read-image/bmt 00"
"rom/programs/read-image/bmt 01"
local numTurtles = 2
for turtleNumber=1,numTurtles do
local montageNumber = string.format("%02d", turtleNumber-1)
turtle.forward();
peripheral.call("bottom", "turnOn")
peripheral.call("bottom", "os.run", "rom/programs/read-image/bmt", montageNumber)
end