Shop OBEX P1 Docs P2 Docs Learn Events
Displaying Information — Parallax Forums

Displaying Information

servelloservello Posts: 113
edited 2008-09-08 00:39 in BASIC Stamp
Hi all,

I'm trying to figure out how I can get the data that is displayed in the DEBUG panel to be displayed on my Parallax 27976 Serial LCD.
How can I do this with my BS2 and a Parallax Temp/Humidity Sensor? I tried replacing the DEBUG command with SEROUT and it's arguments, but was unsuccessful in getting the data to display. The regular text would display, but none of the variable data would.

Best.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Deus tantum me iudicabit

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-07 00:31
    First, figure out the SEROUT statement. Read the sections in the PBasic Manual on DEBUG and SEROUT and compare them.

    If you want suggestions on your SEROUT statement vs. DEBUG statement, you'll have to post them.
    It's hard to tell what's wrong if we don't know what you tried to do.
  • ercoerco Posts: 20,261
    edited 2008-09-07 00:32
    Always post your code for help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-09-07 01:04
    Hi servello, it sounds like you have everything right except the format for your variables. The LCD module expects a serial string of ASCII character codes.

    Your text is formatted to send ASCII character codes when you enclose it in quotes, for example sending "Hello" transmits the 5 character codes (decimal values) 72 101 108 108 111.

    To transmit the ASCII character codes for your variables instead of quotes you would use the DEC formatter eg:

    SEROUT tx,baud,[noparse][[/noparse]DEC my_variable]

    so say my_variable had a decimal value of 74 using the DEC formatter would transmit the two ASCII values 55 52.

    check out the ASCII character codes

    Jeff T.
  • servelloservello Posts: 113
    edited 2008-09-07 01:19
    Thanks, Mike and erco.

    I hadn't posted the code because the examples were very long. So I will attach them here with this post.

    All I want to do is send the data generated by the periphial to an LCD rather than the DEBUG window.

    As I mentioned, I did give it a try before I posted my request for help. I looked at the code for the LCD example and compared it to the DEBUG statements in the Sensor code. The results were less than desirable. Since my attempt was unsuccessful, I did not think to keep the 'merged' code that I wrote.

    I had assumed that it was quite normal to have DATA show on a LCD. I mean, isn't that the whole purpose of an LCD- to let you see what's going on with your circuit?

    Still I have been unable to find any simple example to go by. The documents accompanying the periphials (I have the Flexiforce, Emic, SX-Video Module, Memsic 2125 and Sensirion) all show examples with output to the DEBUG window.

    . . . Help

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Deus tantum me iudicabit
  • servelloservello Posts: 113
    edited 2008-09-07 01:27
    Unsoundcode said...
    Hi servello, it sounds like you have everything right except the format for your variables. The LCD module expects a serial string of ASCII character codes.

    Your text is formatted to send ASCII character codes when you enclose it in quotes, for example sending "Hello" transmits the 5 character codes (decimal values) 72 101 108 108 111.

    To transmit the ASCII character codes for your variables instead of quotes you would use the DEC formatter eg:

    SEROUT tx,baud,[noparse][[/noparse]DEC my_variable]

    so say my_variable had a decimal value of 74 using the DEC formatter would transmit the two ASCII values 55 52.

    check out the ASCII character codes

    Jeff T.

    Thanks. I'll try to work on the code (I'm REAL new here). Do you know of any BS2 code available that can be used as an example? Something that uses the Stamp, an LCD and maybe a Parallax type sensor or periphial (<---how the hell do you spell this) that has the DATA go to the LCD.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Deus tantum me iudicabit
  • FranklinFranklin Posts: 4,747
    edited 2008-09-07 01:52
    Does the LCDTestMessage.bs2 code work for you and if not is your LCD data pin on the BS2 pin 14?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-09-07 01:52


    -- peripheral --
  • servelloservello Posts: 113
    edited 2008-09-07 03:44
    Franklin said...
    Does the LCDTestMessage.bs2 code work for you and if not is your LCD data pin on the BS2 pin 14?

    With just the LCD hooked up it does work, Stephen.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Deus tantum me iudicabit
  • servelloservello Posts: 113
    edited 2008-09-07 04:27
    PJ Allen said...
    -- peripheral --

    [noparse];)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Deus tantum me iudicabit
  • FranklinFranklin Posts: 4,747
    edited 2008-09-07 15:36
    Since the LCD code works and I've used the sht11 code could you attach the code you are trying to get to work and the wiring scheme you are using? That would help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • servelloservello Posts: 113
    edited 2008-09-07 21:45
    Hi Stephen,

    I'll have to start from the beginning, since I didn't save the code from my initial attempt.
    I'll try working on it today (Sunday) and post the code a bit later.

    Thanks for helping out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Deus tantum me iudicabit
  • servelloservello Posts: 113
    edited 2008-09-07 23:39
    OK, Got it. Whew!

    I have the LCD connected to Pin 15 and the Flexiforce sensor connected to Pin 14.

    Here's the code:

    ' Flexiforce_with_LCD.bs2
    ' Displays R/C Discharge Time on LCD
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    ' -----[noparse][[/noparse] Declarations ]----------------------------------------------------
    
    rawForce        VAR     Word            ' Stores raw output
    sensorPin       CON     14              ' Flexiforce sensor circuit
    
    ' -----[noparse][[/noparse] Main Routine ]----------------------------------------------------
    
    SEROUT 15, 84, [noparse][[/noparse]22, 12]                 ' Initialize LCD
    PAUSE  5
    
    Measure:
    
      HIGH sensorPin                        ' Discharge the capacitor
      PAUSE 2
      RCTIME sensorPin,1,rawForce           ' Measure RC charge time
      SEROUT 15, 84, [noparse][[/noparse]"Flexiforce Data = ", DEC rawForce, 128]
    
    GOTO Measure
    
    



    My task now will be to try to get all the other sensors I have, to output to the LCD.
    I forgot to mention in my earlier post that I also have the Parallax RFID, PIR, Dinsmore compass, PING, Light to Frequency module on top of all those already mentioned. I should be quite busy for a while [noparse]:)[/noparse]

    Thanks all for your input.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Deus tantum me iudicabit
  • servelloservello Posts: 113
    edited 2008-09-08 00:39
    For the benefit of any who may have had the same questions I had, I've attached a PDF with a short, simple explanation of what I did and also the code.

    Unfortunately, this server will not allow the PDF to be uploaded, so I've zipped it instead.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Deus tantum me iudicabit
Sign In or Register to comment.