Question about calling a DATA Label in a subroutine
T&E Engineer
Posts: 1,396
Please reference this link: http://forums.parallax.com/showthread.php?p=810347
I have tried to incorporate a left scrolling routine based on some code that JonnyMac wrote for an 8x8 LED display. I can get it to work well if I include the actual name of the DATA label in the subroutine. But if I use something like tmpW1 it does not work. I have attached the updated code and summarized below. Please help me in what I am missing here.
I have tried to incorporate a left scrolling routine based on some code that JonnyMac wrote for an 8x8 LED display. I can get it to work well if I include the actual name of the DATA label in the subroutine. But if I use something like tmpW1 it does not work. I have attached the updated code and summarized below. Please help me in what I am missing here.
DRAW_SCROLL_LEFT SUB 3 ' Scrolls left a 32 x 8 picture
DRAW_SCROLL_LEFT Picture1, 1 'Scrolls left data picture in Label "Picture1:"
SUB DRAW_SCROLL_LEFT tmpW1 = __WPARAM12 ' start of label cs = __PARAM3 FOR tmpB2 = 0 TO 64 STEP 2 tmpB3 = tmpB2 FOR addr = 0 TO 63 READINC [b]Picture1 +[/b] tmpB3, tmpB1 ' read picture data SENDDATA addr, tmpB1, cs NEXT addr DELAY_MS 50 NEXT tmpB2 ENDSUB [b]THIS DRAW ROUTINE BELOW WORKS AND DOES NOT USE THE ACTUAL LABEL NAME[/b] [b]' Use: e.g. DRAW Picture1, DispNo(1-4) [/b] [b]SUB DRAW tmpW1 = __WPARAM12 ' start of label cs = __PARAM3 FOR addr = 0 TO 63 READINC tmpW1, tmpB1 ' read picture data SENDDATA addr, tmpB1, cs NEXT addr ENDSUB[/b] Picture1: 'Picture1 Label (sideways picture) DATA %1111, %1111 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1000, %0001 DATA %1111, %1111 Pad1: DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0 DATA 0,0
Comments
Something like this:
·Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Does that byte of memory hold "A", 65, $41 or %01000001 ?
Yes it does...
·
I think a problem in what you gave me is related to the "STEP 2" portion of the FOR NEXT routine. I just get a bunch of scrambled LEDs scrolling accross. How can this be compensated for?
How does one know to use a READ vs a READINC?
Is there any other posts besides the HELP file on this?
Thanks.
Post Edited (T&E Engineer) : 8/20/2009 12:25:15 PM GMT