PDA

View Full Version : LCD Rolling Odometer Effect



Art
- 15th April 2010, 13:25
Hi Guys,
Has anyone done the rolling odometer effect with PicBasic?
http://www.youtube.com/watch?v=6i0IK64oh8Q&feature=watch_response_rev
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.

rsocor01
- 15th April 2010, 13:49
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/showpost.php?p=78308&postcount=2

Robert

Acetronics2
- 15th April 2010, 17:01
Hi, Art

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

I took a "9" in reverse "rotation"



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

Art
- 15th April 2010, 21:18
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.

Art
- 16th April 2010, 08:29
http://www.youtube.com/watch?v=RMxpPthIShc

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.

Darrel Taylor
- 16th April 2010, 08:40
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. :D

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>

Art
- 16th April 2010, 09:25
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!

Acetronics2
- 16th April 2010, 09:36
Hi,Darrel

What do I Win ???



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

Art
- 17th April 2010, 04:28
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. :D

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.

fratello
- 17th April 2010, 19:13
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 :( ...

Darrel Taylor
- 17th April 2010, 19:49
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>

fratello
- 17th April 2010, 20:28
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 ?! :)

Art
- 18th April 2010, 01:14
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:
http://www.youtube.com/watch?v=T6DAZphHbjI

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.

Darrel Taylor
- 18th April 2010, 17:33
Had me going there for a minute with that video. "Why's everything scrolling?" :eek:
Then the second part came in ... whew ...


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>

Art
- 18th April 2010, 19:25
Haha nice :)

rsocor01
- 21st April 2010, 20:39
Had me going there for a minute with that video. "Why's everything scrolling?" :eek:
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 :D. No, just kidding :). Well done!!

Robert

Darrel Taylor
- 22nd April 2010, 10:38
Thanks Robert, :cool:


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>

rsocor01
- 24th April 2010, 00:47
Nice! :) Somehow, I had the feeling you were going to do it. Good Job!

Robert

Art
- 24th April 2010, 02:34
Wow, a better looking forum :) I guess it is well worth any associated annoyance.

How about a stationery sine wave like this:
http://www.youtube.com/watch?v=dqbEw8_JX2o

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'

SKOLS1
- 25th January 2011, 22:19
Why I can't compile this code,I use PBP and PIC16F628A at 4 MHz.What is missing in the code?

mister_e
- 25th January 2011, 22:56
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 :D

SKOLS1
- 26th January 2011, 09:18
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.

ScaleRobotics
- 26th January 2011, 13:56
Do you have the Elapsed.bas include file? http://www.picbasic.co.uk/forum/showthread.php?t=3251&p=17473#post17473 (http://www.picbasic.co.uk/forum/showthread.php?t=190&p=600#post600)

SKOLS1
- 26th January 2011, 17:46
No,but now I downloaded,where I have to put this file now?
Please explain me where to put this bas file!

ScaleRobotics
- 26th January 2011, 17:59
It needs to be saved in the same dir as the code you are writing.

SKOLS1
- 26th January 2011, 19:40
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

ScaleRobotics
- 26th January 2011, 20:22
Open ASM_INTS.bas and follow the instructions



' --- 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?)

Darrel Taylor
- 27th January 2011, 17:36
(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

ScaleRobotics
- 27th January 2011, 18:10
That's here ...
http://darreltaylor.com/DT_INTS-14/elapsed.html

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.

Darrel Taylor
- 27th January 2011, 18:30
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

SKOLS1
- 27th January 2011, 19:09
it's ok,it's working now.:) I made it.

Samoele
- 2nd March 2011, 14:50
Darrel,

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

Darrel Taylor
- 2nd March 2011, 15:25
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

Mike, K8LH
- 21st August 2011, 14:38
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

Mike, K8LH
- 21st August 2011, 20:34
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