Serial debug with positioning ability
Mightor
Posts: 338
Hey there,
I am looking for a way to allow for my Debug output to be positioned the way you can with the PBASIC language. Has anyone implemented this for the serial port?
For example, I'd like to display a string like "PING Value: " at position 0,0 and then reprint the value at the end of that as it changes, rather than having it scroll line after line as new input arrives. I have no idea how something like that could even be implemented. Does anyone have something like this already? If so, great, I'd love a copy of it, if that's possible. If no one has this, does anyone know what I should look for to get started? I don't mind programming something like this, but I have no idea how to bootstrap myself [noparse]:)[/noparse]
I know this would be easier with an LCD or TV screen, but unfortunately this month's play money was spent getting my 2 Prop protoboards and some other Parallax toys.
Gr,
Mightor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| Any sufficiently advanced technology is indistinguishable from magic.
I am looking for a way to allow for my Debug output to be positioned the way you can with the PBASIC language. Has anyone implemented this for the serial port?
For example, I'd like to display a string like "PING Value: " at position 0,0 and then reprint the value at the end of that as it changes, rather than having it scroll line after line as new input arrives. I have no idea how something like that could even be implemented. Does anyone have something like this already? If so, great, I'd love a copy of it, if that's possible. If no one has this, does anyone know what I should look for to get started? I don't mind programming something like this, but I have no idea how to bootstrap myself [noparse]:)[/noparse]
I know this would be easier with an LCD or TV screen, but unfortunately this month's play money was spent getting my 2 Prop protoboards and some other Parallax toys.
Gr,
Mightor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| Any sufficiently advanced technology is indistinguishable from magic.
Comments
-Phil
Mike,
I cannot find this w_text.spin file you speak. I search the Object Exchange and my computer to no avail. Am I missing something?
Gr,
Mightor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| Any sufficiently advanced technology is indistinguishable from magic.
under "Graham Stabler's Good Thread Index" in the section "Visual:" and you'll see
a link to it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| Any sufficiently advanced technology is indistinguishable from magic.
The cursor control codes are in the help file for the PBASIC Editor. Search "CRSRX", and you should find them all. The PBASIC DEBUG terminal is very friendly and intuitive to use — much more so than HyperTerm. You do have to have the PBASIC editor running to launch it, though.
-Phil
I'm already starting to figure out the ANSI codes for controlling a terminal, it's actually a lot simpler than I had thought. I will need to write a wrapper for one of the FullDuplexSerial derivatives (not sure which one I'll end up picking, we'll see).
It's really as simple as this:
I Googled for the ANSI codes and a complete ASCII table. The w_text module made me realise that I actually don't need very much intelligence in my code, the terminal application does that for me. I just need to supply it with the positions I want to draw my text at.
I prefer to use something like HyperTerm (or PuTTY in my case) instead of the (much easier to use) Basic Stamp debug window because it'd like it to be something that doesn't end up depending on one particular application to be able work. As long as the terminal can do ANSI, it'll be able to grok the output of my Object [noparse]:)[/noparse] (in theory, at least) This should be an interesting project for me to learn SPIN as well.
Btw, there is no such thing as a VARARG function in SPIN, is there? Or is this as achievable as my previous question regarding returning references to an object instance? [noparse]:)[/noparse]
Gr,
Xander
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| Any sufficiently advanced technology is indistinguishable from magic.
I will still continue to tinker with my ANSI terminal output object, if for no other reason than to learn SPIN [noparse]:)[/noparse]
Gr,
Mightor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| Any sufficiently advanced technology is indistinguishable from magic.