Shop OBEX P1 Docs P2 Docs Learn Events
Can a program who normally uses DEBUG statements send it to a display? — Parallax Forums

Can a program who normally uses DEBUG statements send it to a display?

Hello!
I am still designing something new and different. I've worked out how to have the Stamp send what happens when it is working with a TI83Plus calculator and it needs to send the same numbers to the target device. That solution was to have a second stamp receive the input from the target and then display it. The first stamp then does the magic concerning the calculator and the target. However the original program is retained and makes use of the the DEBUG statement to show what the matching numbers are. What I'd like to do is send it to a second display instead. Here:
' {$STAMP BS2}
' {$PBASIC 2.0}

serdata  VAR  Byte
X VAR Byte
again:
'FOR X=1 TO 255
'*****this will wait for serial from calculator
SERIN 15,396,[serdata]

'***this will send it to the pc debug screen
DEBUG DEC serdata, CR
'DEBUG DEC X, CR

'***this will send the same data plus 1 back to the calculator
serdata=serdata + 1
SEROUT 15,396,[serdata]
SEROUT 0,396,[serdata]
SEROUT 1,396,[serdata]
SEROUT 2,396,[serdata]
SEROUT 3,396,[serdata]
GOTO again
'NEXT
That's the program.
I want to have display #2 take over for this line:
DEBUG DEC serdata, CR
Opinions please people.
----
Strange. Erco is that your robot at a rally for a third party political candidate at a political gathering of some kind in the Twin Cities area? I thought he was in the UK playing soccer (English Football)

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2016-03-03 16:18
    DEBUG is just a special form of SEROUT. So if you have a serial LCD for example, you can fairly easily modify the code to use the display instead. Obviously certain formatting commands in DEBUG have to be converted to their equivalent commands on the display, but the raw serial data and even some formatters will still work the same.
  • ercoerco Posts: 20,257
    Strange. Erco is that your robot at a rally for a third party political candidate at a political gathering of some kind in the Twin Cities area? I thought he was in the UK playing soccer (English Football)

    My bot IS in the UK, which is precisely why London has Fallen.




  • DEBUG is just a special form of SEROUT. So if you have a serial LCD for example, you can fairly easily modify the code to use the display instead. Obviously certain formatting commands in DEBUG have to be converted to their equivalent commands on the display, but the raw serial data and even some formatters will still work the same.

    Makes sense. I'm just using the normally used commands there so I don't think there will be a problem.

  • Buck RogersBuck Rogers Posts: 2,187
    edited 2016-03-04 00:01
    erco wrote: »
    Strange. Erco is that your robot at a rally for a third party political candidate at a political gathering of some kind in the Twin Cities area? I thought he was in the UK playing soccer (English Football)

    My bot IS in the UK, which is precisely why London has Fallen.




    Then erco you've got a problem. That means two robots have escaped, with a possibility of one more planning on doing so.

    Especially since one of them has a unique phobia attributed to where you're from.
Sign In or Register to comment.