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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...