Jump to content

Recommended Posts

Posted

Hi guys,

I try to set up a decent GPS system to navigate alle my stuff with it. The core system is up and running, and i can locate all my positions. The only problem that I've is that I cant send my coordinates over rednet. For example I wrote some code:

rednet.open("top", 1)

x, y, z = gps.locate(3)

 

vec={ value1=x, value2=y, value3=z}

svec=textutils.serialize(vec)

rednet.send(1, svec)

 



 

Now on the receiver side:

 


rednet.open("top", 1)

 

id, msg, dist=rednet.receive()

vec=textutils.unserialize(msg)

x=vec.value1

y=vec.value2

z=vec.value3

I cant access the transmited values 1-3 It just crashes with attempt to call nil...

Pls help me I'm getting crazy about this :-D

PS:I've checked svec and it was created correct I think the problem is in the gps.locate function, cause if I hardcode the values 1-3 and then transmit the array everything works like a charm.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...