supra_2010
Member
Scrolling Vertical messages down
' *
' * Project name:
' vertical_messages_down
' ' ' * Description:
' This code demonstrates scrolling vertical messages down
' on 8x32 dor matrix, 2x74hc154.
' * Test configuration:
' MCU: PIC16F628A
'' Oscillator: HS, 20.000 MHz
' config: PWRITE_ON, WDT_OFF, LVP_OFF, HS
' Ext. Modules: None
' SW: mikroBasic v7.2
' date: March 18th, 2010
' * NOTES:
program vertical_messages_down
const supra as byte[30] = (
$00, $46, $49, $49, $49, $31,' // S
$00, $3F, $40, $40, $40, $3F,' // U
$00, $7F, $09, $09, $09, $06,' // P
$00, $7F, $09, $19, $29, $46,' // R
$00, $7E, $11, $11, $11, $7E)' // A
dim i, x as byte
dim temp_array as byte[32]
dim shift, a, value, column as integer
main:
'Set int Port operations
trisb = 0
trisa = 0
portb = 0
porta = 0
cmcon = 7
i = 0
a = 0
x = 0
column = 0
shift = 0
value = 0
start:
' Calculate the number of columns in the text
column = 30
'Temporary array reset
for i = 0 to 31
temp_array = 0 'Array elements start out 0
next i
while true
'Shift operations
for shift = 0 to 31 'prolong spaces to repeat again
'32 columns of text divided into pieces
for i = 0 to 31
value = i + shift /column
if(value > 0) then
temp_array = 0 ' text input
end if
if(value >= 0) and (value <= column - 1) then
temp_array = supra[value]
end if
if(value > column) then
temp_array = 0
end if
next i
'Scanning process
for a = 0 to 40 'control scrolling speeds...higher number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view 32 colums
ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.i = 0
portb = temp_array[x] << shift 'send data to PortB
porta = x 'select the corresponding column
Next x
nop
nop
next a
next shift
wend
goto start
end.
Youtube:
YouTube - scrolling vertical messages down
' *
' * Project name:
' vertical_messages_down
' ' ' * Description:
' This code demonstrates scrolling vertical messages down
' on 8x32 dor matrix, 2x74hc154.
' * Test configuration:
' MCU: PIC16F628A
'' Oscillator: HS, 20.000 MHz
' config: PWRITE_ON, WDT_OFF, LVP_OFF, HS
' Ext. Modules: None
' SW: mikroBasic v7.2
' date: March 18th, 2010
' * NOTES:
program vertical_messages_down
const supra as byte[30] = (
$00, $46, $49, $49, $49, $31,' // S
$00, $3F, $40, $40, $40, $3F,' // U
$00, $7F, $09, $09, $09, $06,' // P
$00, $7F, $09, $19, $29, $46,' // R
$00, $7E, $11, $11, $11, $7E)' // A
dim i, x as byte
dim temp_array as byte[32]
dim shift, a, value, column as integer
main:
'Set int Port operations
trisb = 0
trisa = 0
portb = 0
porta = 0
cmcon = 7
i = 0
a = 0
x = 0
column = 0
shift = 0
value = 0
start:
' Calculate the number of columns in the text
column = 30
'Temporary array reset
for i = 0 to 31
temp_array = 0 'Array elements start out 0
next i
while true
'Shift operations
for shift = 0 to 31 'prolong spaces to repeat again
'32 columns of text divided into pieces
for i = 0 to 31
value = i + shift /column
if(value > 0) then
temp_array = 0 ' text input
end if
if(value >= 0) and (value <= column - 1) then
temp_array = supra[value]
end if
if(value > column) then
temp_array = 0
end if
next i
'Scanning process
for a = 0 to 40 'control scrolling speeds...higher number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view 32 colums
ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.i = 0
portb = temp_array[x] << shift 'send data to PortB
porta = x 'select the corresponding column
Next x
nop
nop
next a
next shift
wend
goto start
end.
Youtube:
YouTube - scrolling vertical messages down