In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: After looking at your program a while I don't think you need more than four bytes of display RAM. It seems that, from time to time, you want to take the pattern that's presently on the LEDs and shift it one way or another; no problem. I created a completely new program template for your 74HC595 hardware; the only thing left from your program is the DATA (some of which is now not necessary) and the connections (though I renamed them to match a 74x595 subroutine I had in place). The demo shows how to loop through the items in a table. A couple of your tables are simply doing shifts and rolls. I created routines that do this without having to read from the table more than once (the first element) -- and you can actually eliminate the table by using the [b]PUT_DRAM[/b] routine. If you want to shift all the LEDs left, for example, call [b]DSHIFT_LEFT[/b] then [b]DRAM_2_LEDS[/b]. This is coded in assembly so that bits can move from one byte in the array to another -- basically, [i]dRam[/i] is a 32-bit value. I also coded routines to "roll" the bits so that the LED on one end wraps around to the other side (is not lost in the bit bucket as with shifting). Both the shift and roll routines allow you to specify the number of bits to move and default to 1 if you don't pass a parameter. See if you can build your show with these new routines. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=324489#m324544 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)