LCD Rolling Odometer Effect


Closed Thread
Results 1 to 35 of 35
  1. #1
    Join Date
    Aug 2003
    Posts
    985

    Default LCD Rolling Odometer Effect

    Hi Guys,
    Has anyone done the rolling odometer effect with PicBasic?

    I've done it with 7 segment displays which is on YouTube as a response to the above video.

    Now I think I can have the effect on a 2x16 LCD with PicBasic.
    Last time I got stuck, and now am pretty certain about what was breaking my code.
    In short, you have to write to all the LCD custom character RAM you want to
    use for a given frame before printing the frame on the LCD.
    I want to make a time display work that way because I'm working on the program currently.

  2. #2
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    644


    Did you find this post helpful? Yes | No

    Default

    Art,

    Nice project. Take a look at Mister_E calculator. It can be downloaded from the next post. Look at the last button "LCD Custom Character". I think you might be able to do it from there.

    http://www.picbasic.co.uk/forum/show...08&postcount=2

    Robert

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Talking Child's game ...

    Hi, Art

    Just a shifting Game ... ( Darrel's courtesy ...)

    I took a "9" in reverse "rotation"

    Code:
      LCDOUT  254,64,14,17,17,15,1,1,17,14     ' Cust Char #0
      LCDOUT  254,72,0,14,17,17,15,1,1,17      ' Cust Char #1
      LCDOUT  254,80,0,0,14,17,17,17,15,1      ' Cust Char #2
      LCDOUT  254,88,0,0,0,14,17,17,15,1       ' Cust Char #3
      LCDOUT  254,96,0,0,0,0,14,17,17,15       ' Cust Char #4
      LCDOUT  254,104,0,0,0,0,0,14,17,17       ' Cust Char #5
      LCDOUT  254,112,0,0,0,0,0,0,14,17        ' Cust Char #6
      LCDOUT  254,120,0,0,0,0,0,0,0,14         ' Cust Char #7
    see how difficult it is ???

    just shift values left or right for normal or reverse "rotation" ... then load the custom characters memory ... and print

    Sooooo Easy ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    I have one digit rolling now, so the others won't be too hard.
    I used this for the data table:
    DATA 142,145,147,149,153,145,142,128 '0
    DATA 132,140,132,132,132,132,142,128 '1
    DATA 142,145,129,130,132,136,159,128 '2
    DATA 159,130,132,130,129,145,142,128 '3
    DATA 130,134,138,146,159,130,130,128 '4
    DATA 159,144,158,129,129,145,142,128 '5
    DATA 134,136,144,158,145,145,142,128 '6
    DATA 159,129,130,132,136,136,136,128 '7
    DATA 142,145,145,142,145,145,142,128 '8
    DATA 142,145,145,143,129,130,140,128 '9
    DATA 142,145,147,149,153,145,142,128 '0
    Although for a clock display, the MSD of the seconds,minutes, and hours
    behave slightly different because they roll over to zero after 5, 5, and 1 respectively.

  5. #5
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default



    Not quite done yet, the hour digits don't yet rotate, but you can't tell that in the video.
    The project is just an internet retrieved time display for another internet enabled project.
    Art.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    What would I do if I didn't have you guys to give me ideas to play with.

    I know you don't need help Art, so don't look at the code till you're done.

    Thanks.

    <object id='stUkhdQ01IR15eRF1fWlhdX15R' width='700' height='344' type='application/x-shockwave-flash' data='http://www.screentoaster.com/swf/STPlayer.swf' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0'><param name='movie' value='http://www.screentoaster.com/swf/STPlayer.swf'/><param name='allowFullScreen' value='true'/><param name='allowScriptAccess' value='always'/><param name='flashvars' value='video=stUkhdQ01IR15eRF1fWlhdX15R'/></object>
    Attached Files Attached Files
    DT

  7. #7
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    Haha, very well done Darrel, I love the video of the simulation,
    and the 23:59:50 test button
    I promise I'll only look when I'm done!

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Wink

    Hi,Darrel

    What do I Win ???

    Code:
    CheckRunSW:
    
    '   IF RUNstat != RUN_SW THEN
    
        IF RUNstat = RUN_SW THEN
            IF !RUN_SW THEN 
                Gosub StartTimer ' Start the Elapsed Timer
            ELSE
                GOSUB StopTimer  ' Stop the Elapsed Timer
            ENDIF
            RUNstat = RUN_SW
        ENDIF
    RETURN
    Clock better starts and stop like that ...

    nice toy ...
    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    What would I do if I didn't have you guys to give me ideas to play with.

    I know you don't need help Art, so don't look at the code till you're done.

    Thanks.
    Well nowhere near as neat and formatted, but I got it done.
    Lead zero blanking for the first digit, and 12 hour time so the least significant hour digit
    has to roll from "2" back to "1" at one O'clock.

    PS, any space saving tips would be very welcome, but it still has to work the way it does.
    Attached Files Attached Files
    Last edited by Art; - 17th April 2010 at 04:36.

  10. #10
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default

    I try to adapt the code of Mr. Taylor (WOW ! How nice example of PBP power !) to my actual hardware (old project...he,he). I just modify the part of "define LCD" but I have this message...What I do wrong ?

    I made this :
    'wsave3 var byte $1A0 SYSTEM ' location for W if in bank3
    in ASM_INTS.bas, and the message has dissapear. It's correct ?


    Offfff.... Simple schematic, simple code, zero results for me ...
    Attached Images Attached Images   
    Attached Files Attached Files
    Last edited by fratello; - 17th April 2010 at 19:58. Reason: I made another mistake ?!

  11. #11
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi fratello,

    The 628A doesn't have any G.P. RAM in bank3.

    In the ASM_INTS.bas file, comment out the wsave3 line.
    <br>
    DT

  12. #12
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default

    So
    "I made this :
    'wsave3 var byte $1A0 SYSTEM ' location for W if in bank3 "
    it's correct !!!
    And my error was :
    TRISB= %00001111
    instead
    TRISB= %00000111
    So simple ! Now code work fine ! Thanks again !
    PS : PBP it's uncharitable with dummy like me , no ?!

  13. #13
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    I thought I'd better post this since the other video is to be deleted,
    and the link will be broken.

    LCD Odometer Rolling Effect:


    Anyone up for horizontal scrolling? It would be more of a challenge I think
    since you'd naturally use a two dimensional array for the custom character
    buffer, but you'd have to work a different way with PicBasic.

  14. #14
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Had me going there for a minute with that video. "Why's everything scrolling?"
    Then the second part came in ... whew ...

    Quote Originally Posted by Art
    Anyone up for horizontal scrolling?
    Ok sure, i'm in ... it's kinda ugly though.

    <object id='stUkhdQ01IR15eRl1bXFtdUFJT' width='700' height='350' type='application/x-shockwave-flash' data='http://www.screentoaster.com/swf/STPlayer.swf' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0'><param name='movie' value='http://www.screentoaster.com/swf/STPlayer.swf'/><param name='allowFullScreen' value='true'/><param name='allowScriptAccess' value='always'/><param name='flashvars' value='video=stUkhdQ01IR15eRl1bXFtdUFJT'/></object>
    Attached Files Attached Files
    DT

  15. #15
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    Haha nice

  16. #16
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    644


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Had me going there for a minute with that video. "Why's everything scrolling?"
    Then the second part came in ... whew ...


    Ok sure, i'm in ... it's kinda ugly though.

    Very nice!! Now, I want to see it scrolling diagonally . No, just kidding . Well done!!

    Robert

  17. #17
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Thanks Robert,

    Quote Originally Posted by rsocor01
    Now, I want to see it scrolling diagonally . No, just kidding
    Hey, why not ... Diagonal it is.

    <object id='stUkhdQ01IR15eSV9UWV9dUFVW' width='700' height='360' type='application/x-shockwave-flash' data='http://www.screentoaster.com/swf/STPlayer.swf' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0'><param name='movie' value='http://www.screentoaster.com/swf/STPlayer.swf'/><param name='allowFullScreen' value='true'/><param name='allowScriptAccess' value='always'/><param name='flashvars' value='video=stUkhdQ01IR15eSV9UWV9dUFVW'/></object>
    Attached Files Attached Files
    DT

  18. #18
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    644


    Did you find this post helpful? Yes | No

    Default

    Nice! Somehow, I had the feeling you were going to do it. Good Job!

    Robert

  19. #19
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    Wow, a better looking forum I guess it is well worth any associated annoyance.

    How about a stationery sine wave like this:


    For pixel width resolution, I don't see any way other than writing a graphics library just for the eight CG characters.
    A character width resolution sounds easy enough though.

    I happen to have an appropriate lookup table from my LED scroller.

    LOOKUP sin,[0,0,1,1,2,2,2,3,3,4,4,3,3,2,2,2,1,1,0,0],bally'

  20. #20
    Join Date
    Jan 2011
    Location
    Skopje,Macedonia
    Posts
    71


    Did you find this post helpful? Yes | No

    Default

    Why I can't compile this code,I use PBP and PIC16F628A at 4 MHz.What is missing in the code?

  21. #21
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Which code?

    What are the error you get?

    Why are we able to send people on the moon, but can't solve stinky feet problems on earth?

    Those are the questions
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  22. #22
    Join Date
    Jan 2011
    Location
    Skopje,Macedonia
    Posts
    71


    Did you find this post helpful? Yes | No

    Default

    Warning:Unable to open INCLUDE file ELAPSED.BAS. That says when I compile the code from Darrel Taylor.But when I compile the code from Art it's ok,it's working.

  23. #23
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Last edited by ScaleRobotics; - 26th January 2011 at 14:41.

  24. #24
    Join Date
    Jan 2011
    Location
    Skopje,Macedonia
    Posts
    71


    Did you find this post helpful? Yes | No

    Default

    No,but now I downloaded,where I have to put this file now?
    Please explain me where to put this bas file!

  25. #25
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    It needs to be saved in the same dir as the code you are writing.
    Last edited by ScaleRobotics; - 26th January 2011 at 18:23.

  26. #26
    Join Date
    Jan 2011
    Location
    Skopje,Macedonia
    Posts
    71


    Did you find this post helpful? Yes | No

    Default

    I make new folder in the C:/Program File/Mecanuiqe/MSC/NEW FOLDER
    and In the new folder there is the compiled code and Included file Elapsed.bas.I compile it,but now I have another problem.It says this ERROR: Variable wsave3 position request 416 beyond RAM_END 335.
    What is this??

    OK,I compile for PIC16F877,and it's working.But when I hold the Button RA3 it's not working,I mean the clock it isnt working
    Last edited by SKOLS1; - 26th January 2011 at 19:57.

  27. #27
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Open ASM_INTS.bas and follow the instructions

    Code:
    ' --- IF any of these three lines cause an error ?? Simply Comment them out to fix the problem ----
    wsave1 var byte $A0 SYSTEM ' location for W if in bank1
    wsave2 var byte $120 SYSTEM ' location for W if in bank2
    wsave3 var byte $1A0 SYSTEM ' location for W if in bank3
    (also, there might be a newer elapsed.bas that uses DT_INTS. Does anyone know where that is?)

  28. #28
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    (also, there might be a newer elapsed.bas that uses DT_INTS. Does anyone know where that is?)
    That's here ...
    http://darreltaylor.com/DT_INTS-14/elapsed.html
    DT

  29. #29
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Yes, but (I am sure it is right in front of me) I don't see a place to download the elapsed code from there. It is obvious for the INTS-18 though. The link to PBPGroup has an Elapsed that has Include "ASM_INTS.bas" ' ASM Interrupt Stubs, but I am thinking there is one for DT_INTS.

  30. #30
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    DOH!

    You're right, there's no download.
    I used to have it in the main .zip file, but it's not there in the latest version.
    I'll put it up again separately.

    Thanks Walter
    DT

  31. #31
    Join Date
    Jan 2011
    Location
    Skopje,Macedonia
    Posts
    71


    Did you find this post helpful? Yes | No

    Default

    it's ok,it's working now. I made it.

  32. #32
    Join Date
    Jan 2006
    Location
    Slovenia EU
    Posts
    32


    Did you find this post helpful? Yes | No

    Default Re: LCD Rolling Odometer Effect

    Darrel,

    I couldn't see your picture on this thread.
    Who can find include file "elapsed.bas"?

  33. #33
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: LCD Rolling Odometer Effect

    Yeah, screentoaster.com went out of business, and I lost all the video's I recorded.
    A lesson learned about using FREE services .. they're costly in the end.

    You can get Elapsed.bas from here ...
    http://www.picbasic.co.uk/forum/showthread.php?t=190
    Last edited by Darrel Taylor; - 2nd March 2011 at 15:30.
    DT

  34. #34
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: LCD Rolling Odometer Effect

    Has anyone come across LCDs that have too slow a refresh rate to support animation like this rolling odometer effect? I have two generic QY-162A modules (2x16, white letters on blue background, HD44780 compatible) and I have to slow down the scrolling interval to a half second in order to see it. Do I need a different type of 2x16 LCD?

    TIA... Mike

  35. #35
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: LCD Rolling Odometer Effect

    Update: I found an old 2x16 LCD without back light and animation works fine so I guess I just need to figure out which of the newer displays out there have a better refresh rate.

    Regards, Mike

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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