Shop OBEX P1 Docs P2 Docs Learn Events
Basic Debug Commands (Spin) — Parallax Forums

Basic Debug Commands (Spin)

codysprakercodyspraker Posts: 46
edited 2012-08-22 10:22 in Propeller 1
Hey guys, I don't want to waste anyone's time with such a basic topic but I have given a bit of time trying to find a basic way to cleanup the debug (FullDuplexSerialPlus) for my Propeller Spin Program. I am displaying data from multiple sensors onboard and they are not very clean without the basic ability to format like adding a new line. Am I just missing some of the basics or are these commands not present in the debug program? Thanks for the help guys

Comments

  • msrobotsmsrobots Posts: 3,709
    edited 2012-08-22 03:35
    Hi codyspraker,
    I guess you miss something there.

    for a new line you simply transmit a CarriageReturn aka ascii 13

    fds.tx(13) for example

    there are also methods to call for outputting strings, hex and decimal numbers as Text to your serial Terminal

    fds.dec(128) will output a to text converted number "128"

    fds.hex(128) gives you "7F"

    just look at the source of FullDuplexSerial.spin

    In PropellerTool Software on the left side you find a dropdown. Select "Propeller Library". Then you see all the spin library files in the tree-view left side. Look for FullDuplexSerial.spin. Look at the source and you will find several PUB methods. There you find all what you need to format your output nicely...

    Enjoy!

    Mike
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-08-22 09:07
    Parallax Serial Terminal.spin has formatting methods that let you place text at X and Y coordinates in the terminal window.

    If you want to look at an example of how to use the formatting methods, I believe my QuickStart servo tester code uses them.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2012-08-22 09:22
    If you click the "Prefs..." button in Parallax Serial Terminal and then click the "Function" tab in the Preferences dialog box, you can view/select the ASCII control characters it recognizes.
  • codysprakercodyspraker Posts: 46
    edited 2012-08-22 10:18
    Thanks! This was a perfect answer for what I was looking for, I was not able to clearly understand the PUB declarations in the debug file but you cleared things up.
  • JonnyMacJonnyMac Posts: 9,194
    edited 2012-08-22 10:22
    When I'm developing new projects I often start a "background" cog to send desired values to PST while the program is running. This only works with globals, but also means that sending values doesn't interfere with the process being tested, and is very easily removed.
Sign In or Register to comment.