Shop OBEX P1 Docs P2 Docs Learn Events
Debug terminal text on LCD display? — Parallax Forums

Debug terminal text on LCD display?

henriknchenriknc Posts: 1
edited 2015-02-15 23:17 in BASIC Stamp
Hi all! I have a simple emitter/detector setup on the BoE and I have written the code so that the debug terminal displays every break in the the infrared led an photodiode and counts every time that happens. Now I would like to have the count displayed on the Parallex 2x16 Serial LCD display. Is there anyway to simple store the "debug" code into the LCD Display so when I use the sensor I dont need to have my laptop with me?

Another options is writing code for the serial display to react to what the sensor is doing, but I do not know of any "if" statements for the serial display! the examples provided are only pre-written text to store.

Any help is appreciated!

The sensor code is displayed below:

counter VAR Byte ' Trip Counter

' ---- [Main Code]

DEBUG "Program running, waiting for break in signal..." ' Initiates program
PAUSE 1000 ' Waiting for sensor to initiate
DEBUG CLS ' Starts counting


' ---- [Phototransistor initiation]

DO
DEBUG HOME, "IN15 - ", BIN IN15 ' Displays binary voltage signal
PAUSE 100
HIGH 0

IF IN15 = 0 THEN ' Motion Detected?
counter = counter + 1 ' Update Trip Counter

DEBUG HOME, "TRIPPED...", DEC3 counter
DO : LOOP UNTIL IN15 = 1 ' Wait For Object To Clear
DEBUG HOME, "CLEARED...", DEC3 counter

ENDIF

LOOP

' ---- [IR LED initiation]

DO
HIGH 0
LOOP

Comments

  • JonnyMacJonnyMac Posts: 9,014
    edited 2015-02-15 12:04
    Remember that DEBUG is simply a special form of SEROUT that uses pin 16 (programming connection) at 9600 baud. That is to say that anything you can do with DEBUG, you can do with SEROUT to your LCD. Have you explored conditional programming? If not, please do -- this will allow you to selectively-enable features in your programs.
  • ajwardajward Posts: 1,130
    edited 2015-02-15 23:17
    Not too difficult at all. I have a 2x16 LCD displaying data from a 3-axis accelerometer.

    attachment.php?attachmentid=113199&d=1424070636

    The product guide should tell you just about all you need.

    Amanda
Sign In or Register to comment.