Results 1 to 7 of 7

Thread: batch file programming LCD's

  1. #1
    Newbie
    Join Date
    May 2002
    Location
    Australia
    Posts
    30

    batch file programming LCD's

    When i start my mp3box i want to write something on the LCD screen.
    i'ts running msdos and and when i boot it up i will make a autoexec.bat type of file and make it print on the screen a program selection. What i was wondering if anyone has tryied this, is in batch file programming you can redirect an output to a serial port or paralell port instead of the screen so if i ECHO'ed some text to the Com1 or LPTn port will is print it on the LCD? I can't try this at the moment becasue i don't have one.

    or if not can anyone sujest anything else.



    by the way anyone wants to know a bit of batch file programming it can be really useful. goto http://www.astalavista.com/code/dos/batch.shtml it's a very nice tut.
    Cheers Mosh

  2. #2
    FLAC
    Join Date
    Apr 2001
    Location
    Here, There, Everywhere
    Posts
    1,436

    Re: batch file programming LCD's

    you need to locate a little utility called lcdprint.exe. I have seen it floating around a bit, never used it myself personally....

    then u can do things like

    c:\>lcdprint.exe "Hello you, reading the LCD"

    you can't just pipe the output from a DOS ECHO,etc to a printer/serial port and expect some action. its a little more advanced than that.....
    Project - GAME OVER :(

  3. #3
    Low Bitrate
    Join Date
    Apr 2002
    Location
    Bay Area, California, USA
    Posts
    64
    Here's the page for LCDPrint, it says it will print a text file, dunno about just strings. I can't try it because I don't have an LCD yet.

    http://www.geocities.com/SiliconVall...therUtils.html

    Someone else in this thread says they have been able to do what you mention (pipe text to com1).

    A question for parallel LCD users

    Hope it works. Please post your success/failure because I expect to do something similar.

  4. #4
    Newbie
    Join Date
    May 2002
    Location
    Australia
    Posts
    30

    cheers

    Thnx for that people
    much appriciated when i get my LCD I'll try the LCDprint
    I'll keep u posted
    Cheers Mosh

  5. #5
    Newbie
    Join Date
    Feb 2002
    Location
    UK
    Posts
    51
    This is easy to do in a batch file, but only if you've got a serial LCD.

    MODE COM1:9600,N,8,1,P
    ECHO put your text here >COM1

    assuming your serial LCD is configured for 9600 baud.

    first line sets up the serial port - type MODE /? from a DOS prompt for more info. Make sure you've wired the LCD up correctly, or you'll get an Abort/Retry/Ignore error.

    For a parallel LCD, it's a lot more involved, so LCDPRINT would be the best way to go.
    -------
    bum. broke it.

  6. #6
    Variable Bitrate
    Join Date
    Dec 2001
    Location
    Paignton, Devon, UK
    Posts
    315
    This is easy to do with LCD Print using simple dos batch commands (old dos skills alert! )

    You can use the dos command echo and redirect it to a text file (e.g. c:\out.txt) by using the following lines:

    "
    echo Congratulations, your lcd is working! > c:\out.txt
    lcdprint 378 40 4 c:\out.txt
    "

    where 378 is your parallel port address and 40 4 is your lcd size

    However, this isn't much good to get multiline output (as in on all lines of your lcd). The best way I know to do this is to create individual text files for the lines on your display and then combine them before outputting the combined file to the lcd using lcdprint.

    Here is a pretty good way to do this - the example used is for a 40 x 4 display:

    "
    echo Line 1 of the display > c:\message1.txt
    echo Line 2 of the display > c:\message2.txt
    echo Line 3 of the display > c:\message3.txt
    echo Line 4 of the display > c:\message4.txt
    copy c:\message*.txt c:\out.txt /y
    lcdprint 378 40 4 c:\out.txt
    "

    Basically, you prepare each line of your text and send it to an individual filename sharing a common beginning (e.g. message*.txt). The copy command then combines the files including a carriage return at the end of each file, giving you a 4 line text document. You must be sure to add the /y extension on or it will not overwrite c:\out.txt if it already exists. Then, LCDprint is called to output the text to the screen.

    Things are so much easier in visual basic...

    If you are still stuck then I can send you a dummy batch file e.t.c.

    Have Fun

    Andrew
    Mediabox Hardware Project
    Current Stage: A complete redesign, although not much happening right now!

    Mediabox Software Project
    Status: Writing Sync Software (still) and playing around with interface
    To do: Far too much!

  7. #7
    Newbie
    Join Date
    May 2002
    Location
    Australia
    Posts
    30

    cheers andrew and kaysee

    U guys were alot of help thanks so much that.
    The LCDprint looks like the way to go


    thanks so much
    Cheers Mosh

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •