Shop OBEX P1 Docs P2 Docs Learn Events
Global TV_Text — Parallax Forums

Global TV_Text

John AbshierJohn Abshier Posts: 1,116
edited 2006-11-10 02:17 in Propeller 1
My Spin program is structured
·· SRF08Demo· ' object to call SRF08 and print out some results
····· tv : "TV_Text"·· ' writes to TV
····· RF : "SRF08"····· ' object that reads SRF08 ultrasonic rangefinders
I would also like to write to the TV from the SRF08 object, but it cannot see the name tv.· If I add a new TV_Text object in the SRF08 object, both try to control the tv and the display is hosed.· Commenting out all references to the TV_Text object in the top object to write out a quick debug in the SRF08 object is a pain.· I guess I could write to the USB2Serial chip on the Demo board, but that requires closing the Propeller Tool, another pain.· When debug screens (like in PBASIC) are added, it would be nice if different objects could open different debug screens.· Have I missed the cool way to handle this situation or is it just something I will have to live with?

Comments

  • cgraceycgracey Posts: 14,133
    edited 2006-11-09 22:54
    Well, the object heirarchy cannot be gotten around. Only the object that contains TV can talk to it. I think what you'll need to do is have the object that contains TV, go ask HRF08 for some data, and then send it to the TV, itself.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • John AbshierJohn Abshier Posts: 1,116
    edited 2006-11-09 23:01
    That what I would do if my program were working correctly. I am trying to debug where my program is hanging.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-11-10 02:17
    There is a way to do this, but it would involve changes that you're probably not prepared to do. The Propeller OS that I wrote is able to do this by separating out the variables that the display uses from the routines that manipulate them. The variables are all referenced by a pointer at a specific location in memory. Two different objects can include the display routines since each copy has none of its own variables and they all reference the same global copies. (You would need to use a semaphore with LOCKxx if the two objects were running in separate cogs).

    Another thing I've done to debug routines in different cogs is to use both a TV driver and a VGA driver at the same time with one handling the debug output only.
Sign In or Register to comment.