3 posts
Posted 14 January 2013 - 10:07 AM
Hi
I am trying to send command via rednet from computer (ex. go up 1) to wireless turtle, and then have turtle run program named same as command.d
Turtle should run program "go up 1" when computer sends it message "go up 1" and run program "go down 2" when computer sends it message "go down 2".
Computer code:
rednet.open("left")
rednet.send(6,read())
Turtle code:
rednet.open("right")
id, message = rednet.receive()
1111 posts
Location
Portland OR
Posted 14 January 2013 - 10:16 AM
1522 posts
Location
The Netherlands
Posted 14 January 2013 - 10:20 AM
rednet.send(id, message)
P1, p2, p3 = rednet.receive()
Shell l.run("p2")
3 posts
Posted 14 January 2013 - 10:29 AM
Turtle says no such program after it received command "go up 1" from computer.
Used code on turtle:
rednet.open("right")
id,message=rednet.receive()
shell.run(message)
2088 posts
Location
South Africa
Posted 14 January 2013 - 10:39 AM
Turtle says no such program after it received command "go up 1" from computer.
Used code on turtle:
rednet.open("right")
id,message=rednet.receive()
shell.run(message)
Are you sending exactly and only 'go up 1'
It should work, if it says no such program, then there's no go program on the turtle
3 posts
Posted 14 January 2013 - 10:46 AM
First I run program on turtle for receiving command, then one on computer for sending, after running it it asks me for input in which I type "go up 1" without quotation, then I leave it and right click turtle where it says No such program.
EDIT
Using command on turtle directly works.
2005 posts
Posted 14 January 2013 - 12:56 PM
put a print to print out what you're using in shell.run()
235 posts
Location
/dev/earth1aus5
Posted 14 January 2013 - 01:01 PM
Try these (in separate programs)
Firstly, try
shell.run("go up 1")
If that works, then try
rednet.open( SIDE )
id, message = rednet.receive()
print(message)
shell.run(message)
If that works, then your program is doing something weird.