Shop OBEX P1 Docs P2 Docs Learn Events
Lcd code — Parallax Forums

Lcd code

NEMESISNEMESIS Posts: 2
edited 2005-05-25 03:08 in General Discussion
Is there any generic LCD code for serial lcds? I am trying to write code for a PJRC LCD 24 X 8 screen to display debug data from a BS2. Does any one have a sample program or code for something like this?

-JEFF

Comments

  • dandreaedandreae Posts: 1,375
    edited 2005-05-19 21:23
    If you are using BS2 you can use the "SEROUT" command depending on the protocol of the LCD.· Try this sample code for the BS2:

    SEROUT Pin#,16468,[noparse][[/noparse]"Hello World!"]
    or
    SEROUT Pin#,84,[noparse][[/noparse]"Hello World!"]

    There maybe some commands that are needed to clear the LCD and other functions, please check the specifications for your LCD.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
  • NEMESISNEMESIS Posts: 2
    edited 2005-05-25 03:08
    Ok, another little note on this project:

    I've tried using the prograqm example to get something to come on to the lcd. this is the code·I have been using thus far with no success:



    charn·· VAR·· Byte(4)················· 'var for chars from coprocessors.
    tmp·· VAR·· Word···················· 'temp var.

    grnled·· CON·· 11················· 'green led.
    redled·· CON·· 10················· 'red led.
    speaker·· CON·· 9················· 'speaker.
    net·· CON·· 8···················· 'coprocessor network.
    baud·· CON·· 396···················· 'network baud rat.
    lcdrx·· CON·· 4····················· 'lcd Rx
    lcdtx·· CON·· 5····················· 'lcd Tx
    LOW speaker······················· 'turn off speaker.

    GOSUB honk······················· 'test speaker.
    GOSUB honk······················· 'test speaker.
    GOSUB honk······················· 'test speaker.



    '
    'main loop.
    'loop here until something happens.
    '
    main
    '
    · ' SEROUT lcdrx, 396,[noparse][[/noparse]"Hello World!"]


    ·· GOTO main···················· 'loop.


    '

    '
    ····· LCD CODE START····
    ·SEROUT 4,16468,[noparse][[/noparse]"Hello World!"]··· 'didnt work <<<<<<<<<<<<<<
    '········ or
    'SEROUT 4,84,[noparse][[/noparse]"Hello World!"]······· ' was· SEROUT 5,84,[noparse][[/noparse]"Hello World!"]· << didnt work
    ·' SEROUT lcdrx,"Hello World!"
    '
    ······ LCD CODE END·····
    '


    '
    'beep beep honk honk.
    '
    honk
    ·· FREQOUT speaker,200,1500
    ·· LOW speaker
    RETURN

    So far it only does the beeping.·I have included several things in this code to help me know that data has actually been processed through the controller board·I am using. Which by the way·I am attempting to use the Arobot controler board from arrick robotics.

    More about the lcd:

    It is a PJRC 24 x8 LCD module with a daughter board developed to adapt to a db9 rs232 female adapter. BAUD is at 9600, but the controller board is at 2400. I have tried adjusting the BAUD accordingly (a function of the daughter board) but also·to no avail.·The pin connections are as such:

    BS2···· LCD

    4········ Rx

    5········ Tx

    ·So far the results have varied from a bunch of characters scrolling on the screen (quasi matrix code style...cool but at this time useless) to a bunch of rabdom X's and 0's to a clear screen. i cant seem to put a curser on the screen, any messages, or find any way of toggling lines.

    I have also left in some random comments in the code to help mark attempts I have made in my previous attempts.

    I hope this helps a bit. I would like to hear some sort of feed back soon. I need all the help i can get!!! thanks

    -Jeff
Sign In or Register to comment.