Shop OBEX P1 Docs P2 Docs Learn Events
moving a byte array from one object to another? — Parallax Forums

moving a byte array from one object to another?

I have a byte array that I need to access from another cog. I cant seem to get the data. Please provide some light on the subject so that I may understand addressing better.
var
 byte data[20]

Pub list_results(in) 
 return @data


This example simply wont cut it for some reason. I call it from another cog.

Comments

  • That looks fine to me.

    I'm guessing the problem is arising from the top object.

    You don't need to worry about sharing RAM between cogs in Spin. All RAM accessible by Spin is in the hub and is shared no matter which cog accesses it.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2016-09-27 17:40
    I'm going to guess the top object places an "@" symbol in from of the returned value. In this case (if I'm assuming correctly) the "@" symbol shouldn't be used (by the top object, the way you using it the child is fine).
  • Wow its working. My mistake :(
Sign In or Register to comment.