' ************************************ ' * Scrolling Sign * ' * by Drew Hickman - copyright 1998 * ' * * ' * bitvar b5 is a temp var used to * ' * calculate other bitvars. * ' ************************************ Symbol PortA=5 Symbol TrisA=$85 Symbol PortB=6 Symbol TrisB=$86 Symbol Brightness=2 'display brightness Symbol Width=10 'number of columns of LEDs in display Symbol Delay=5 'scroll speed (smaller=faster) Symbol Length=35 'message length 'this equals (# of data-width of display)+1 b6=0 'the display's refresh loop counter b1=0 'temporary table lookup result bitvar b2=0 'scroll speed control (bigger=slower) b3=0 'pointer to start of display (it moves) b4=0 'temporary table lookup index bitvar poke trisa,0 'port A all output poke trisb,0 'port B all output Main: poke porta,1 'reset the 4017 chip step 1 poke porta,0 'reset the 4017 chip step 2 b6=0 'reset the loop counter b5=b2+1 : b2=b5 'add one to the scroll speed control if b2=delay then Scroll 'scroll delay - is it time to scroll? Loop: b4=b3+b6 'set temp table lookup pointer lookup b4,(127,127,127,127,127,127,127,127,127,127,62,0,62,63,31,127,55,5,63,127,55,43,43,95,127,95,43,43,7,127,127,127,127,127,127,127,127,127,127),b1 poke portb,b1 'light up the correct LEDs pause brightness 'so you can see the LEDs poke portb,127 'turn off all LEDs high 7 'increment 4017 to next column b5=b6+1 : b6=b5 'increment loop counter if b6=width then Main 'if counter is width of display, reset refresh goto Loop 'else loop to next column Scroll: b5=b3+1 : b3=b5 'move table pointer to start of display b2=0 'reset speed counter if b3=length then Reset 'if at the end of the sign, then goto Next goto Loop 'loop to next column Reset: b3=0 'we are at the end of the sign so reset pointer goto Main 'loop to next column