Shop OBEX P1 Docs P2 Docs Learn Events
Opening the Debug Screen — Parallax Forums

Opening the Debug Screen

HumanoidoHumanoido Posts: 5,770
edited 2008-05-13 10:11 in BASIC Stamp
I noticed the debug screen opens up with a simple debug statement.

DEBUG " "

I know it's possible to replace debug commands with their serout
equivalents. However, these do not open up the debug screen.

SEROUT 16, BAUD, [noparse][[/noparse]" "]

Is there a serout statement that can open a debug screen?

humanoido

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-05-06 01:47
    No but the serout command outputs to a terminal program like HyperTerminal. You could (I think) manually open the debug screen from the editor but debug is for "debugging" and isn't really ment to be used in finished code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-05-08 11:20
    I was thinking more about controlling the Parallax Editor on the pc by using the Basic Stamp. The debug screen or memory map will open with a keyboard control character. I want the BS2px to send control characters to the pc. The test would be to send a ctrl-M to bring up the memory map. Of course this is just to demo the technique is working. Once the Basic Stamp is able to send control characters, it can do some remote control on the pc and the Basic Stamp Editor in addition to other apps. So far, this is what I've learned about sending serial control characters.

    ' SENDING CONTROL CHARACTERS
    '

    ' To send a control character, count the consecutive number of the letter.
    ' For example, A is 1, C is 3, E is 5 and so one. (See chart below)
    ' Then use the following format. [noparse][[/noparse]example sends a control (ctrl) M]
    ' SEROUT 16, T19K2, [noparse][[/noparse]13]

    However, this result is linked to the editor screen, and is also the code to send a carriage return. Both cannot be the same! Refer to the serout screen formatting in the stamp editor help under the index of serout, to see the table showing the result of using the formatting number 13. So how can we send one control code one place and another control code another place using the basic stamp? Or will it take some special wiring to do this?

    humanoido

    ' ALPHA NUMBERS FOR SENDING CONTROL CODES
    '

    ' CODE LETTER
    '
    ' 1 A
    ' 2 B
    ' 3 C
    ' 4 D
    ' 5 E
    ' 6 F
    ' 7 G
    ' 8 H
    ' 9 I
    ' 10 J
    ' 11 K
    ' 12 L
    ' 13 M
    ' 14 N
    ' 15 O
    ' 16 P
    ' 17 Q
    ' 18 R
    ' 19 S
    ' 20 T
    ' 21 U
    ' 22 V
    ' 23 W
    ' 24 X
    ' 25 Y
    ' 26 Z
  • FranklinFranklin Posts: 4,747
    edited 2008-05-09 03:53
    The debug terminal is a terminal program built into the editor and is no different than an external terminal program. It's just easier while debugging a program to have it open automatically when envoked. The codes the stamp is sending to the pc are the same either way.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-05-09 16:22
    I found that the debug screen is receiving the codes
    but not the pc. Is there a way to send control
    codes to the pc using the stamp? What would the
    sample program look like?

    humanoido
  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-09 17:46
    The PC is receiving the control codes just like any other character. They're all just 7 or 8 bit values depending on how the serial port is configured. It's just that the control codes are the values less than 32 (the value of a space) and terminal programs interpret these values in special ways. You send control codes to the PC from the Stamp the same way you'd send any other character. For example, to send a carriage return, you'd use "DEBUG 13" or "SEROUT <pin>,<Baud>,[noparse][[/noparse]13]".
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-05-11 06:59
    So instead of typing the key on the computer keyboard,
    i.e. a ctrl-M to bring up the memory map in the Editor, can
    the Basic Stamp send it? Or the wiring is not there to do it?

    humanoido
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-05-11 16:19
    Hi , one easy way to emulate keyboard input to a PC using the serial output from a Stamp is to use a software application installed on the PC such as that at the following link http://forums.parallax.com/showthread.php?p=627711

    I don't know if that is the version you need or not but QuattroRS4 has one or two posts related to the same issue I just posted the first link that came up in my search.

    You will have to give thought to exactly what you want to achieve and to how the PC's applications react to keyboard and serial input.

    Using a Visual Basic application you will want to know whether the·Stamp IDE·is open and has focus or if you need to search through the directory structure and have the VB app open the IDE for you. Only one application can own the serial port at any one·time so if you intended to use the debug window you would have to close the session from the Stamp to the VB app before using debug in the Parallax IDE. There are a multitude of if's and but's and a multitude of ways you could handle the situation, if you think a VB keyboard emulator would suit your purpose give a few more specifics on what you want. Opening the memory map is a straight forward operation if the Stamp IDE has focus and a valid program loaded but I don't see what purpose it serves. I think you have something else in mind if you can share it perhaps it can be done.

    hope this helps

    Jeff T.
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-05-13 10:11
    Thanks everyone for the good advice. That's a unique way of controlling serial input from the stamp to the computer by using a VB program. It looks like handling the entire task with only the Basic Stamp will be too challenging. I hoped that sending a control character to the computer using only the Basic Stamp would be more simple, but the reality of doing it is more challenging than expected. My interest in Pbasic programming is purely academic and project varied out of love for the Basic Stamp series of microcontrollers and Penguin Robot.

    humanoido
Sign In or Register to comment.