Code:
DEFINE OSC 12
'ADCON1 = 4 'this sets ANO, AN1, AN3 ON
ADCON1 = 7' ALL DIGITAL
TRISB = 0
TRISC = 0
SINK VAR PORTB 'ROWS
SOURCE VAR PORTC 'COLUMNS
x var byte
y var byte
z var byte
A VAR BYTE
B VAR BYTE
S VAR BYTE
STP VAR BYTE
'CHAR var byte[8]
SOURCEA VAR WORD
SOURCEB VAR WORD
SOURCEC VAR WORD
SOURCED VAR WORD
SOURCEE VAR WORD
SOURCEF VAR WORD
SOURCEG VAR WORD
SOURCEH VAR WORD
LETTERS VAR BYTE ' VARIABLE TO HOLD CHARACTERS IN F/N LOOP
CHAR var byte[26]' ARRAY VARIABLE NAMED CHAR 26 ELEMENTS
'* * * * * * LOAD ARRAY WITH STRING VALUE * * * * * * * * * * *
CHAR[0]= "A"
CHAR[1]= "B"
CHAR[2]= "C"
CHAR[3]= "D"
CHAR[4]= "E"
CHAR[5]= "F"
CHAR[6]= "G"
CHAR[7]= "H"
CHAR[8]= "I"
CHAR[9]= "J"
CHAR[10]="K"
CHAR[11]="L"
CHAR[12]="M"
CHAR[13]="N"
CHAR[14]="O"
CHAR[15]="P"
CHAR[16]="Q"
CHAR[17]="R"
CHAR[18]="S"
CHAR[19]="T"
CHAR[20]="U"
CHAR[21]="V"
CHAR[22]="W"
CHAR[23]="X"
CHAR[24]="Y"
CHAR[25]="Z"
MAIN2:
for x = 0 to 10
lookup x, [0,1,2,3,3,3,2,2,1,1,0], LETTERS 'EQUIVALENT TO a,b,c,d,d,d,c,c,b,b,a
'NOT WORKING OBVIOUSLY
'FOR LETTERS = 0 TO 2 'LOOKUP ASCII CHARACTERS STORED IN MATRICE ARRAY ,A,B,C
'FOR STP = 0 TO 1 'SCROLL CHARACTER OFF PAGE NOT SURE HOW TO IMPLEMENT
'FOR S = 0 TO 1 'MULTIPLEX SCREEN PAUSING ~10ms EACH SCAN
GoSub display 'FETCH THE 8 ROWS
'NEXT S
'NEXT STP
NEXT X
GOTO MAIN2
display: 'A 'B 'C 'D 'E
Lookup LETTERS, [$0, $0, $0, $0], SOURCEA
PORTC = SOURCEA
PORTB = %11111110
PAUSE 1
Lookup LETTERS, [%01000010, %01111110, %01111110,%01111110], SOURCEB
PORTC = SOURCEB
PORTB = %11111101
PAUSE 1
Lookup LETTERS, [%01000010, %01000010, %00000010,%01000010], SOURCEC
PORTC = SOURCEC
PORTB = %11111011
PAUSE 1
Lookup LETTERS, [%01111110,%01000010 , %00000010,%01000010], SOURCED
PORTC = SOURCED
PORTB = %11110111
PAUSE 1
Lookup LETTERS, [%01000010, %01000110, %00100010,%01100010], SOURCEE
PORTC = SOURCEE
PORTB = %11101111
PAUSE 1
Lookup LETTERS, [%00111100, %00111010, %00111100,%01011100], SOURCEF
PORTC = SOURCEF
PORTB = %11011111
PAUSE 1
Lookup LETTERS, [$0, %00000010, $0,%01000000], SOURCEG
PORTC = SOURCEG
PORTB = %10111111
PAUSE 1
Lookup LETTERS, [$0, %00000010, $0,%01000000], SOURCEH
PORTC = SOURCEH
PORTB = %01111111
PAUSE 1
FOR STP = 0 TO 7 'SCROLL MR. SMILEY OFF SCREEN
FOR S = 0 TO 15 'SCAN SCREEN 21 TIMES (FAST) BETWEEN SCROLLING
PAUSE 1
PORTB = %11111110
PORTC = SOURCEA >>STP
PAUSE 1
PORTB = %11111101
PORTC = SOURCEB >>STP
PAUSE 1
PORTB = %11111011
PORTC = SOURCEC >>STP
PAUSE 1
PORTB = %11110111
PORTC = SOURCED >>STP
PAUSE 1
PORTB = %11101111
PORTC = SOURCEE >>STP
PAUSE 1
PORTB = %11011111
PORTC = SOURCEF >>STP
PAUSE 1
PORTB = %10111111
PORTC = SOURCEG >>STP
PAUSE 1
PORTB = %01111111
PORTC = SOURCEH >>STP
NEXT S
NEXT STP
'GOTO MAIN
RETURN
Bookmarks