' IF THIS FIRST LINE DOESNT WORK TRY THE SECOND, OR DELETE AND REPLACE ALL NAMES WITH VALUE
DIM Column_Length AS BYTE = 96 ' cathodes
DIM Column_Length = 96 AS BYTE ' cathodes
DIM Colum_start AS BYTE ' cathodes
DIM Display_Out AS BYTE ' CONST array data
DIM Sentence_Data( Column_Length) AS BYTE ' SAFE PLACE TO WRITE data to send to matrix
DIM Display_Buffer( Column_Length) AS BYTE ' BACKBUFFER to matrix
DIM Anode_Data AS PORTC ' Anodes
DIM Data_Bus AS portb ' red cathodes
DIM x AS BYTE
DIM y AS BYTE
DIM Speed AS BYTE
DIM Speed_Counter AS BYTE
//SUB ROUTINES
SUB Load_Buffer()
' do you know how to read binary, the columns will output the count as such
FOR x = 0 TO Column_Length' 120 / 8 = 15
Display_Buffer(x) = (x) 'Sentence_Data(x)
NEXT
END SUB
SUB Draw_Data()
porta = 0 ' lets ignore the green
FOR x = Colum_start TO (Colum_start+7) ' COLUMS ON PORT b counter
Display_Out = Display_Buffer(x) ' const data
Data_Bus = Display_Out XOR $11111111 ' inverts the CONST array data at the port SETS UP PORTB
' WHAT ARE THESE 2 LINES ?? LOOKS LIKE A REPEAT OF THE LAST, MAY NEED DELETING
'Display_Buffer(x) = Sentence_Data(x)
'Data_Bus = Sentence_Data XOR %11111111 ' reverse the data bits
Anode_Data = 1
FOR Y = 1 TO 8 ' ROWS ON PORT A counter
' ONLY USE ONE OF THESE 3 LINES, NOT SURE WHICH WILL WORK FOR SF
'Anode_Data = 1 <<Y ' Anodes ' cycle the anodes from 0 to 7
'Anode_Data = 2^Y' Anodes ' cycle the anodes from 0 to 7
Anode_Data = Anode_Data * 2 ' Anodes ' cycle the anodes from 0 to 7
DELAYMS(50) ' ADJUST THIS TO BALANCE BETWEEN BRIGHTNESS AND FLICKER
NEXT ' Y
NEXT 'X
END SUB
'SUB Scroll_Text()
'IF Speed <> 0 THEN
'DEC(Speed)
'ELSE
'Speed = 6
'Colum_start = Colum_start + 1
'IF Colum_start + 8 = Column_Length THEN ' # of elements in CONST array Colum Start is Cathodes on portb
'Colum_start = 0
'END IF
'END IF
'END SUB
SetAllDigital // Make all Pins digital I/O's
TRISC = %00000000 // Make PORTD all outputs
TRISB = %00000000 // Make PORTB all outputs
TRISA= %00000000 // Make PORTB all outputs
y = 0
Speed = 10
Load_Buffer()
WHILE true
FOR Colum_start = 0 TO Column_Length - 8
FOR Speed_Counter = 0 TO Speed
Draw_Data()
NEXT 'Speed_Counter
NEXT 'Colum_start
WEND