Shop OBEX P1 Docs P2 Docs Learn Events
How do I share the serial terminal between object? — Parallax Forums

How do I share the serial terminal between object?

Is this possible? I'm trying to debug a program with multiple objects. Can I use the same serial terminal object on both of my program objects or can I only talk to one at a time? Do I need to close one PST object and start the other?

Comments

  • I think there are a couple version of multi object serial objects. I know I have a couple. I'll look for one and add it here (unless someone beats me to it).
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-09-25 15:43
    Here's one version of a serial object which can be used from multiple objects. You'll need to include the object in the "OBJ" section of each object using serial driver but only call the start method once.

    If you need one to work from multiple cogs, then you need to use locks, I have a couple versions with locks so let me know if you need one.

    BTW, It's worth looking at the difference between this PST and the normal PST. You'll see I moved the variables and buffers to the DAT section which allows the variables to be shared among multiple objects.
  • zepperikzepperik Posts: 16
    edited 2015-09-25 17:37
    Works great! Awesome!
Sign In or Register to comment.