Results 1 to 2 of 2

Thread: Scrolling Message on a LCD

  1. #1
    Join Date
    Jun 2002
    Location
    Montréal, Québec
    Posts
    771

    Default Scrolling Message on a LCD

    Ok here is a tip for those who have LCD which can display (for instance) winamp's currently playing song.

    Ifever your songname is longer than the size of your LCD, you only see a part of it.

    Here is how I managed scrolling

    1- using DVD-Spy, I collect the songname, put it to a string "filename"
    2- once per second (using time server plug-in) I run the song checkup

    ---
    Song Chek-up: Ifever the stored name is different than my previously "oldname" I consider it a new song, else I consider it the same song.


    oldname == filename;

    ---
    new song: I store the name in "oldname".
    I store the name (with pretty modifications to look good) into another string "displayname".
    I send "displayname" to LCD for display

    oldname = filename;
    displayname = filename;

    ---

    Old song: I verify if "displayname"'s lenght (GVMS) if it is longer than my LCD size, I scroll, else I sent it to LCD for displayal (no scroll needed for small names)

    strlen(displayname) > 20;

    ---

    Scroll: I put the 1st character into a string "charOne", I cut the "displayname" to remove 1st char, and I add "charOne" at the end.
    I send the new "displayname" to LCD for display

    charone = cut(displayname, 0, 1);
    displayname= cut(displayname, 1, ((strlen(displayname))-1)) + charone;


    ---
    Hope his helps.

  2. #2
    Join Date
    Jun 2002
    Location
    Montréal, Québec
    Posts
    771

    Default ... :o

    or you can download the newly made LCD version 2.

    scrolls like a charm with HD44780 LCDs.


Posting Permissions

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