supra_56
Member level 1
- Joined
- Sep 30, 2009
- Messages
- 39
- Helped
- 4
- Reputation
- 8
- Reaction score
- 4
- Trophy points
- 1,288
- Location
- Toronto, Canada
- Activity points
- 1,715
program MikroBasic_Messages
' * Description: Scrolled to right
' *modified by: supra
' * Test configuration:
' MCU: PIC16F628A
' Misc: 74hc154; 8*32 dot matrix
' Oscillator: 20.0000 MHz
' config: PWRITE_ON, WDT_OFF, LVP_OFF, HS
' Ext. Modules: -
' SW: mikroBasic V7.0.0.2
const text as integer[262] =(
$7F, $09, $09, $09, $06, $00, ' P
$41, $7F, $41, $00, ' I
$3E, $41, $41, $41, $22, $00,' C
$42, $7F, $40, $00, ' 1
$3C, $4A, $49, $49, $30, $00,' 6
$7F, $09, $09, $01, $01, $00,' F
$3C, $4A, $49, $49, $30, $00,' 6
$42, $61, $51, $49, $46, $00,' 2
$36, $49, $49, $49, $36, $00,' 8
$7E, $11, $11, $11, $7E, $00,' A
$00, $00, $00, $00, $00, $00,' space
$7F, $20, $18, $20, $7F, $00,' W
$44, $7D, $40, $00, ' i
$04, $3F, $44, $40, $20, $00, 't
$7F, $08, $04, $04, $78, $00, 'h
$00, $00, $00, $00, $00, $00,' space
$01, $71, $09, $05, $03, $00,' 7
$18, $14, $12, $7F, $10, $00,' 4
$7F, $08, $08, $08, $7F, $00,' H
$3E, $41, $41, $41, $22, $00,' C
$00, $42, $7F, $40, $00, ' 1
$27, $45, $45, $45, $39, $00,' 5
$18, $14, $12, $7F, $10, $00,' 4
$00, $00, $00, $00, $00, $00,' space
$36, $49, $49, $49, $36, $00,' 8
$63, $14, $08, $14, $63, $00,' X
$21, $41, $45, $4B, $31, $00,' 3
$42, $61, $51, $49, $46, $00,' 2
$00, $00, $00, $00, $00, $00,' space
$7F, $02, $04, $02, $7F, $00,' M
$20, $54, $54, $54, $78, $00, 'a
$04, $3F, $44, $40, $20, $00, 't
$7C, $08, $04, $04, $08, $00, 'r
$44, $7D, $40, $00, 'i
$44, $28, $10, $28, $44, $00, 'x
$00, $00, $00, $00, $00, $00,' space
$7F, $02, $04, $02, $7F, $00,' M
$44, $7D, $40, $00, 'i
$7F, $10, $28, $44, $00, 'k
$7C, $08, $04, $04, $08, $00, 'r
$38, $44, $44, $44, $38, $00, 'o
$7F, $49, $49, $49, $36, $00,' B
$20, $54, $54, $54, $78, $00, 'a
$48, $54, $54, $54, $24, $00, 's
$44, $7D, $40, $00, 'i
$38, $44, $44, $44, $44, $00) 'c
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 = 262
'Temporary array reset
for i = 0 to 31
temp_array = 0 'Array elements start out 0
next i
while true
'Shift operations
for shift = -32 to column 'prolong spaces to repeat again
'16 columns of text divided into pieces
for i = 0 to 31
value = i + shift
if(value > 0) then
temp_array = 0 ' text input
end if
if(value >= 0) and (value <= column - 1) then
temp_array = text[value]
end if
if(value > column) then
temp_array = 0
end if
next i
'Scanning process
for a = 0 to 25 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.i = 0
portb = temp_array[x] 'send data to PortB
porta = x 'select the corresponding column
Next x
next a
next shift
wend
goto start
end.
Here is video on youtube:
https://www.youtube.com/watch?v=I7xS1hszyus
Added after 3 minutes:
This one is scrolling text to right
Look in bold below:
Scroll messages from left to right:
program scrolling_messages_to_right
' * Description: messages will scrolled from left to right
' *modified by: supra
' * Test configuration:
' MCU: PIC16F628A
' chip: 74hc154
' Oscillator: 20.0000 MHz
' config: PWRITE_ON, WDT_OFF, LVP_OFF, HS,
' Ext. Modules: -
' SW: mikroBasic V7.0.0.2
const text as byte[237] =(
$7F, $09, $09, $09, $06, ' P
$00, $41, $7F, $41, $00, ' I
$3E, $41, $41, $41, $22, $00,' C
$00, $42, $7F, $40, $00, ' 1
$3C, $4A, $49, $49, $30, $00,' 6
$7F, $09, $09, $01, $01, $00,' F
$3C, $4A, $49, $49, $30, $00,' 6
$42, $61, $51, $49, $46, $00,' 2
$36, $49, $49, $49, $36, $00,' 8
$7E, $11, $11, $11, $7E, $00,' A
$00, ' space
$7F, $20, $18, $20, $7F, $00,' W
$00, $41, $7F, $41, $00, ' I
$01, $01, $7F, $01, $01, $00,' T
$7F, $08, $08, $08, $7F, $00,' H
$00, ' space
$01, $71, $09, $05, $03, $00,' 7
$18, $14, $12, $7F, $10, $00,' 4
$7F, $08, $08, $08, $7F, $00,' H
$3E, $41, $41, $41, $22, $00,' C
$00, $42, $7F, $40, $00, ' 1
$27, $45, $45, $45, $39, $00,' 5
$18, $14, $12, $7F, $10, $00,' 4
$00, ' space
$36, $49, $49, $49, $36, $00,' 8
$63, $14, $08, $14, $63, $00,' X
$36, $49, $49, $49, $36, $00,' 8
$00, ' space
$7F, $02, $04, $02, $7F, $00,' M
$7E, $11, $11, $11, $7E, $00,' A
$01, $01, $7F, $01, $01, $00,' T
$7F, $09, $19, $29, $46, $00,' R
$00, $41, $7F, $41, $00, ' I
$63, $14, $08, $14, $63, $00,' X
$00, ' space
$7F, $02, $04, $02, $7F, $00,' M
$00, $41, $7F, $41, $00, ' I
$7F, $08, $14, $22, $41, $00,' K
$7F, $09, $19, $29, $46, $00,' R
$3E, $41, $41, $41, $3E, $00,' O
$7F, $49, $49, $49, $36, $00,' B
$7E, $11, $11, $11, $7E, $00,' A
$46, $49, $49, $49, $31, $00,' S
$00, $41, $7F, $41, $00, ' I
$3E, $41, $41, $41, $22, $00)' C
dim i, x, column as byte
dim tmp_arr as byte[32]
dim shift, a, value 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
column = 237 'Calculate the number of columns in the text
for i = 0 to 31 'Temporary array reset
tmp_arr = 0 'Array elements start out 0
next i
while 1= 1
for shift = -32 to column 'Shift operations. Start at column 1
for i = 0 to 31 '32 columns of text divided into pieces
value = (i - shift) + 237
if(value > 0 ) then
tmp_arr = 0 'start over
end if
if(value >= 0) and (value <= column - 1) then
tmp_arr = text[value]
end if
next i
'Scanning process
for a = 0 to 70 'control scrolling speeds...higher number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
' ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.i = 0
portb = tmp_arr[x] 'send data to PortB
porta = x 'select the corresponding column
porta.x = 0 'prevented ghosting
Next x
next a
next shift
wend
end.
Please see to on my youtube.
https://www.youtube.com/watch?v=Ux1Yw-cYCgg
Added after 2 minutes:
scroll to left/right; wipein/wipeout, fadein/fadeout
program title_effects
' *Description: still; scroll to left/right; wipein/wipeout, fadein/fadeout
' *modified by supra;
' * Test configuration:
' MCU: PIC16F628A
' Misc: 8x32 dot matrix, 74HC154
' Oscillator: 20.0000 MHz
' config: PWRITE_ON, WDT_OFF, LVP_OFF, HS
' Ext. Modules: -
' SW: mikroBasic V7.0.0.2
const supra as byte[30] = (
$46, $49, $49, $49, $31, $00,' S
$3F, $40, $40, $40, $3F, $00,' U
$7F, $09, $09, $09, $06, $00,' P
$7F, $09, $19, $29, $46, $00,' R
$7E, $11, $11, $11, $7E, $00)' A )
const text as integer[262] =(
$7F, $09, $09, $09, $06, $00, ' P
$41, $7F, $41, $00, ' I
$3E, $41, $41, $41, $22, $00,' C
$42, $7F, $40, $00, ' 1
$3C, $4A, $49, $49, $30, $00,' 6
$7F, $09, $09, $01, $01, $00,' F
$3C, $4A, $49, $49, $30, $00,' 6
$42, $61, $51, $49, $46, $00,' 2
$36, $49, $49, $49, $36, $00,' 8
$7E, $11, $11, $11, $7E, $00,' A
$00, $00, $00, $00, $00, $00,' space
$7F, $20, $18, $20, $7F, $00,' W
$44, $7D, $40, $00, ' i
$04, $3F, $44, $40, $20, $00, 't
$7F, $08, $04, $04, $78, $00, 'h
$00, $00, $00, $00, $00, $00,' space
$01, $71, $09, $05, $03, $00,' 7
$18, $14, $12, $7F, $10, $00,' 4
$7F, $08, $08, $08, $7F, $00,' H
$3E, $41, $41, $41, $22, $00,' C
$00, $42, $7F, $40, $00, ' 1
$27, $45, $45, $45, $39, $00,' 5
$18, $14, $12, $7F, $10, $00,' 4
$00, $00, $00, $00, $00, $00,' space
$36, $49, $49, $49, $36, $00,' 8
$63, $14, $08, $14, $63, $00,' X
$21, $41, $45, $4B, $31, $00,' 3
$42, $61, $51, $49, $46, $00,' 2
$00, $00, $00, $00, $00, $00,' space
$7F, $02, $04, $02, $7F, $00,' M
$20, $54, $54, $54, $78, $00, 'a
$04, $3F, $44, $40, $20, $00, 't
$7C, $08, $04, $04, $08, $00, 'r
$44, $7D, $40, $00, 'i
$44, $28, $10, $28, $44, $00, 'x
$00, $00, $00, $00, $00, $00,' space
$7F, $02, $04, $02, $7F, $00,' M
$44, $7D, $40, $00, 'i
$7F, $10, $28, $44, $00, 'k
$7C, $08, $04, $04, $08, $00, 'r
$38, $44, $44, $44, $38, $00, 'o
$7F, $49, $49, $49, $36, $00,' B
$20, $54, $54, $54, $78, $00, 'a
$48, $54, $54, $54, $24, $00, 's
$44, $7D, $40, $00, 'i
$38, $44, $44, $44, $44, $00) 'c
dim aa as word
dim i, x, bs as byte
dim temp_array as byte[32]
dim shift, a, value, column as integer
sub procedure supra_title
dim bb, dd as byte
dd = 0
While inc(dd) < 70 'to control speed
PORTA = 0
For bb = 0 to 29
bs = supra[bb]
PORTB = bs
delay_us(1000)
PORTB = 0
PORTA = bb + 1
Next bb
Wend
end sub
sub procedure call_supra_title
' Do
'supra_title
while true
for i = 0 to 30 'numbers of columns to be displayed
portb = supra
porta = i
next i
wend
' aa = aa + 6
'Loop Until aa > 24
end sub
sub procedure scanning_to_left
i = 0
a = 0
column = 0
shift = 0
value = 0
' Calculate the number of columns in the supra
column = 30
'reset all 32 columns
for i = 0 to 31
temp_array = 0 'Array elements start out 0
next i
'shift operations
for shift = -32 to column 'prolong spaces to repeat again
'32 columns of supra divided into pieces
for i = 0 to 31
value = i + shift
if(value > 0 ) then
temp_array = 0 ' supra 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 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'number of columns view
'ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x 'select the corresponding column
Next x
next a
next shift
end sub
sub procedure scanning_to_right
i = 0
a = 0
x = 0
column = 0
shift = 0
value = 0
column = 30 'Calculate the number of columns in the text
for i = 0 to 31 'Temporary array reset
temp_array = 0 'Array elements start out 0
next i
for shift = 0 to column 'Shift operations. Start at column 1
for i = 0 to 31 '32 columns of text divided into pieces
value = (i - shift) + column
if(value > 0 ) then
temp_array = 0 'start over
end if
if(value >= 0) and (value <= column) then
temp_array = supra[value]
end if
if(value > column) then
temp_array = 0
end if
next i
'Scanning process
for a = 0 to 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
' ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x 'start at column 1
Next x
next a
next shift
end sub
sub procedure wipein_wipeout
i = 0
a = 0
x = 0
column = 0
shift = 0
value = 0
column = 30 'Calculate the number of columns in the text
for i = 0 to 31 'Temporary array reset
temp_array = 0 'Array elements start out 0
next i
for shift = -32 to column
for i = 0 to 31
value = i + shift
if(value >= 0) and (value <= column - 1) then
temp_array[i + shift + 1]= supra[value]
' temp_array= supra[value]
end if
if(value > column) then
temp_array[i-1] = 0
end if
next i
'Scanning process
for a = 0 to 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
' ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x '+ shift 'start at column 1
Next x
next a
next shift
end sub
sub procedure wipein_fadein
i = 0
a = 0
x = 0
column = 0
shift = 0
value = 0
column = 30 'Calculate the number of columns in the text
for i = 0 to 31 'Temporary array reset
temp_array = 0 'Array elements start out 0
next i
for shift = -32 to column
for i = 0 to 31
value = i + shift
if(value >= 0) and (value <= column - 1) then
temp_array= supra[value]
end if
if(value > column) then
temp_array[i-1] = 0
end if
next i
'Scanning process
for a = 0 to 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x + shift 'start at column 1
Next x
next a
next shift
end sub
sub procedure wipein_supra_wipeout_supra
i = 0
a = 0
x = 0
column = 0
shift = 0
value = 0
column = 30 'Calculate the number of columns in the text
for i = 0 to 31 'Temporary array reset
temp_array = 0 'Array elements start out 0
next i
for shift = -32 to column
for i = 0 to 31
value = i + shift
if(value >= 0) and (value <= column - 1) then
temp_array[i + shift + 1]= supra[value]
' temp_array= supra[value]
end if
if(value > column) then
temp_array[i-1] = 0
end if
next i
'Scanning process
for a = 0 to 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
' ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x '+ shift 'start at column 1
Next x
next a
next shift
end sub
sub procedure string_messages
i = 0
a = 0
column = 0
shift = 0
value = 0
' Calculate the number of columns in the text
column = 262
'reset all 32 columns
for i = 0 to 31
temp_array = 0 'Array elements start out 0
next i
'shift operations
for shift = -32 to column 'prolong spaces to repeat again
'32 columns of supra divided into pieces
for i = 0 to 31
value = i + shift
if(value > 0 ) then
temp_array = 0 ' supra input
end if
if(value >= 0) and (value <= column - 1) then
temp_array = text[value]
end if
if(value > column) then
temp_array = 0
end if
next i
'scanning process
for a = 0 to 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'number of columns view
'ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x 'select the corresponding column
Next x
next a
next shift
end sub
main:
trisb = 0
trisa = 0
portb = 0
porta = 0
cmcon = 7
start:
ClearBit(PORTA, i)
supra_title
scanning_to_left
scanning_to_right
wipein_wipeout
wipein_fadein
string_messages
goto start
end.
To see on my youtube:
https://www.youtube.com/watch?v=MQdfT2_JgZg
PS: The word supra is caused by lightning while shooting video. It is still effect. But on breadboarding does not flashing all times.
' * Description: Scrolled to right
' *modified by: supra
' * Test configuration:
' MCU: PIC16F628A
' Misc: 74hc154; 8*32 dot matrix
' Oscillator: 20.0000 MHz
' config: PWRITE_ON, WDT_OFF, LVP_OFF, HS
' Ext. Modules: -
' SW: mikroBasic V7.0.0.2
const text as integer[262] =(
$7F, $09, $09, $09, $06, $00, ' P
$41, $7F, $41, $00, ' I
$3E, $41, $41, $41, $22, $00,' C
$42, $7F, $40, $00, ' 1
$3C, $4A, $49, $49, $30, $00,' 6
$7F, $09, $09, $01, $01, $00,' F
$3C, $4A, $49, $49, $30, $00,' 6
$42, $61, $51, $49, $46, $00,' 2
$36, $49, $49, $49, $36, $00,' 8
$7E, $11, $11, $11, $7E, $00,' A
$00, $00, $00, $00, $00, $00,' space
$7F, $20, $18, $20, $7F, $00,' W
$44, $7D, $40, $00, ' i
$04, $3F, $44, $40, $20, $00, 't
$7F, $08, $04, $04, $78, $00, 'h
$00, $00, $00, $00, $00, $00,' space
$01, $71, $09, $05, $03, $00,' 7
$18, $14, $12, $7F, $10, $00,' 4
$7F, $08, $08, $08, $7F, $00,' H
$3E, $41, $41, $41, $22, $00,' C
$00, $42, $7F, $40, $00, ' 1
$27, $45, $45, $45, $39, $00,' 5
$18, $14, $12, $7F, $10, $00,' 4
$00, $00, $00, $00, $00, $00,' space
$36, $49, $49, $49, $36, $00,' 8
$63, $14, $08, $14, $63, $00,' X
$21, $41, $45, $4B, $31, $00,' 3
$42, $61, $51, $49, $46, $00,' 2
$00, $00, $00, $00, $00, $00,' space
$7F, $02, $04, $02, $7F, $00,' M
$20, $54, $54, $54, $78, $00, 'a
$04, $3F, $44, $40, $20, $00, 't
$7C, $08, $04, $04, $08, $00, 'r
$44, $7D, $40, $00, 'i
$44, $28, $10, $28, $44, $00, 'x
$00, $00, $00, $00, $00, $00,' space
$7F, $02, $04, $02, $7F, $00,' M
$44, $7D, $40, $00, 'i
$7F, $10, $28, $44, $00, 'k
$7C, $08, $04, $04, $08, $00, 'r
$38, $44, $44, $44, $38, $00, 'o
$7F, $49, $49, $49, $36, $00,' B
$20, $54, $54, $54, $78, $00, 'a
$48, $54, $54, $54, $24, $00, 's
$44, $7D, $40, $00, 'i
$38, $44, $44, $44, $44, $00) 'c
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 = 262
'Temporary array reset
for i = 0 to 31
temp_array = 0 'Array elements start out 0
next i
while true
'Shift operations
for shift = -32 to column 'prolong spaces to repeat again
'16 columns of text divided into pieces
for i = 0 to 31
value = i + shift
if(value > 0) then
temp_array = 0 ' text input
end if
if(value >= 0) and (value <= column - 1) then
temp_array = text[value]
end if
if(value > column) then
temp_array = 0
end if
next i
'Scanning process
for a = 0 to 25 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.i = 0
portb = temp_array[x] 'send data to PortB
porta = x 'select the corresponding column
Next x
next a
next shift
wend
goto start
end.
Here is video on youtube:
https://www.youtube.com/watch?v=I7xS1hszyus
Added after 3 minutes:
This one is scrolling text to right
Look in bold below:
Scroll messages from left to right:
program scrolling_messages_to_right
' * Description: messages will scrolled from left to right
' *modified by: supra
' * Test configuration:
' MCU: PIC16F628A
' chip: 74hc154
' Oscillator: 20.0000 MHz
' config: PWRITE_ON, WDT_OFF, LVP_OFF, HS,
' Ext. Modules: -
' SW: mikroBasic V7.0.0.2
const text as byte[237] =(
$7F, $09, $09, $09, $06, ' P
$00, $41, $7F, $41, $00, ' I
$3E, $41, $41, $41, $22, $00,' C
$00, $42, $7F, $40, $00, ' 1
$3C, $4A, $49, $49, $30, $00,' 6
$7F, $09, $09, $01, $01, $00,' F
$3C, $4A, $49, $49, $30, $00,' 6
$42, $61, $51, $49, $46, $00,' 2
$36, $49, $49, $49, $36, $00,' 8
$7E, $11, $11, $11, $7E, $00,' A
$00, ' space
$7F, $20, $18, $20, $7F, $00,' W
$00, $41, $7F, $41, $00, ' I
$01, $01, $7F, $01, $01, $00,' T
$7F, $08, $08, $08, $7F, $00,' H
$00, ' space
$01, $71, $09, $05, $03, $00,' 7
$18, $14, $12, $7F, $10, $00,' 4
$7F, $08, $08, $08, $7F, $00,' H
$3E, $41, $41, $41, $22, $00,' C
$00, $42, $7F, $40, $00, ' 1
$27, $45, $45, $45, $39, $00,' 5
$18, $14, $12, $7F, $10, $00,' 4
$00, ' space
$36, $49, $49, $49, $36, $00,' 8
$63, $14, $08, $14, $63, $00,' X
$36, $49, $49, $49, $36, $00,' 8
$00, ' space
$7F, $02, $04, $02, $7F, $00,' M
$7E, $11, $11, $11, $7E, $00,' A
$01, $01, $7F, $01, $01, $00,' T
$7F, $09, $19, $29, $46, $00,' R
$00, $41, $7F, $41, $00, ' I
$63, $14, $08, $14, $63, $00,' X
$00, ' space
$7F, $02, $04, $02, $7F, $00,' M
$00, $41, $7F, $41, $00, ' I
$7F, $08, $14, $22, $41, $00,' K
$7F, $09, $19, $29, $46, $00,' R
$3E, $41, $41, $41, $3E, $00,' O
$7F, $49, $49, $49, $36, $00,' B
$7E, $11, $11, $11, $7E, $00,' A
$46, $49, $49, $49, $31, $00,' S
$00, $41, $7F, $41, $00, ' I
$3E, $41, $41, $41, $22, $00)' C
dim i, x, column as byte
dim tmp_arr as byte[32]
dim shift, a, value 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
column = 237 'Calculate the number of columns in the text
for i = 0 to 31 'Temporary array reset
tmp_arr = 0 'Array elements start out 0
next i
while 1= 1
for shift = -32 to column 'Shift operations. Start at column 1
for i = 0 to 31 '32 columns of text divided into pieces
value = (i - shift) + 237
if(value > 0 ) then
tmp_arr = 0 'start over
end if
if(value >= 0) and (value <= column - 1) then
tmp_arr = text[value]
end if
next i
'Scanning process
for a = 0 to 70 'control scrolling speeds...higher number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
' ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.i = 0
portb = tmp_arr[x] 'send data to PortB
porta = x 'select the corresponding column
porta.x = 0 'prevented ghosting
Next x
next a
next shift
wend
end.
Please see to on my youtube.
https://www.youtube.com/watch?v=Ux1Yw-cYCgg
Added after 2 minutes:
scroll to left/right; wipein/wipeout, fadein/fadeout
program title_effects
' *Description: still; scroll to left/right; wipein/wipeout, fadein/fadeout
' *modified by supra;
' * Test configuration:
' MCU: PIC16F628A
' Misc: 8x32 dot matrix, 74HC154
' Oscillator: 20.0000 MHz
' config: PWRITE_ON, WDT_OFF, LVP_OFF, HS
' Ext. Modules: -
' SW: mikroBasic V7.0.0.2
const supra as byte[30] = (
$46, $49, $49, $49, $31, $00,' S
$3F, $40, $40, $40, $3F, $00,' U
$7F, $09, $09, $09, $06, $00,' P
$7F, $09, $19, $29, $46, $00,' R
$7E, $11, $11, $11, $7E, $00)' A )
const text as integer[262] =(
$7F, $09, $09, $09, $06, $00, ' P
$41, $7F, $41, $00, ' I
$3E, $41, $41, $41, $22, $00,' C
$42, $7F, $40, $00, ' 1
$3C, $4A, $49, $49, $30, $00,' 6
$7F, $09, $09, $01, $01, $00,' F
$3C, $4A, $49, $49, $30, $00,' 6
$42, $61, $51, $49, $46, $00,' 2
$36, $49, $49, $49, $36, $00,' 8
$7E, $11, $11, $11, $7E, $00,' A
$00, $00, $00, $00, $00, $00,' space
$7F, $20, $18, $20, $7F, $00,' W
$44, $7D, $40, $00, ' i
$04, $3F, $44, $40, $20, $00, 't
$7F, $08, $04, $04, $78, $00, 'h
$00, $00, $00, $00, $00, $00,' space
$01, $71, $09, $05, $03, $00,' 7
$18, $14, $12, $7F, $10, $00,' 4
$7F, $08, $08, $08, $7F, $00,' H
$3E, $41, $41, $41, $22, $00,' C
$00, $42, $7F, $40, $00, ' 1
$27, $45, $45, $45, $39, $00,' 5
$18, $14, $12, $7F, $10, $00,' 4
$00, $00, $00, $00, $00, $00,' space
$36, $49, $49, $49, $36, $00,' 8
$63, $14, $08, $14, $63, $00,' X
$21, $41, $45, $4B, $31, $00,' 3
$42, $61, $51, $49, $46, $00,' 2
$00, $00, $00, $00, $00, $00,' space
$7F, $02, $04, $02, $7F, $00,' M
$20, $54, $54, $54, $78, $00, 'a
$04, $3F, $44, $40, $20, $00, 't
$7C, $08, $04, $04, $08, $00, 'r
$44, $7D, $40, $00, 'i
$44, $28, $10, $28, $44, $00, 'x
$00, $00, $00, $00, $00, $00,' space
$7F, $02, $04, $02, $7F, $00,' M
$44, $7D, $40, $00, 'i
$7F, $10, $28, $44, $00, 'k
$7C, $08, $04, $04, $08, $00, 'r
$38, $44, $44, $44, $38, $00, 'o
$7F, $49, $49, $49, $36, $00,' B
$20, $54, $54, $54, $78, $00, 'a
$48, $54, $54, $54, $24, $00, 's
$44, $7D, $40, $00, 'i
$38, $44, $44, $44, $44, $00) 'c
dim aa as word
dim i, x, bs as byte
dim temp_array as byte[32]
dim shift, a, value, column as integer
sub procedure supra_title
dim bb, dd as byte
dd = 0
While inc(dd) < 70 'to control speed
PORTA = 0
For bb = 0 to 29
bs = supra[bb]
PORTB = bs
delay_us(1000)
PORTB = 0
PORTA = bb + 1
Next bb
Wend
end sub
sub procedure call_supra_title
' Do
'supra_title
while true
for i = 0 to 30 'numbers of columns to be displayed
portb = supra
porta = i
next i
wend
' aa = aa + 6
'Loop Until aa > 24
end sub
sub procedure scanning_to_left
i = 0
a = 0
column = 0
shift = 0
value = 0
' Calculate the number of columns in the supra
column = 30
'reset all 32 columns
for i = 0 to 31
temp_array = 0 'Array elements start out 0
next i
'shift operations
for shift = -32 to column 'prolong spaces to repeat again
'32 columns of supra divided into pieces
for i = 0 to 31
value = i + shift
if(value > 0 ) then
temp_array = 0 ' supra 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 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'number of columns view
'ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x 'select the corresponding column
Next x
next a
next shift
end sub
sub procedure scanning_to_right
i = 0
a = 0
x = 0
column = 0
shift = 0
value = 0
column = 30 'Calculate the number of columns in the text
for i = 0 to 31 'Temporary array reset
temp_array = 0 'Array elements start out 0
next i
for shift = 0 to column 'Shift operations. Start at column 1
for i = 0 to 31 '32 columns of text divided into pieces
value = (i - shift) + column
if(value > 0 ) then
temp_array = 0 'start over
end if
if(value >= 0) and (value <= column) then
temp_array = supra[value]
end if
if(value > column) then
temp_array = 0
end if
next i
'Scanning process
for a = 0 to 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
' ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x 'start at column 1
Next x
next a
next shift
end sub
sub procedure wipein_wipeout
i = 0
a = 0
x = 0
column = 0
shift = 0
value = 0
column = 30 'Calculate the number of columns in the text
for i = 0 to 31 'Temporary array reset
temp_array = 0 'Array elements start out 0
next i
for shift = -32 to column
for i = 0 to 31
value = i + shift
if(value >= 0) and (value <= column - 1) then
temp_array[i + shift + 1]= supra[value]
' temp_array= supra[value]
end if
if(value > column) then
temp_array[i-1] = 0
end if
next i
'Scanning process
for a = 0 to 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
' ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x '+ shift 'start at column 1
Next x
next a
next shift
end sub
sub procedure wipein_fadein
i = 0
a = 0
x = 0
column = 0
shift = 0
value = 0
column = 30 'Calculate the number of columns in the text
for i = 0 to 31 'Temporary array reset
temp_array = 0 'Array elements start out 0
next i
for shift = -32 to column
for i = 0 to 31
value = i + shift
if(value >= 0) and (value <= column - 1) then
temp_array= supra[value]
end if
if(value > column) then
temp_array[i-1] = 0
end if
next i
'Scanning process
for a = 0 to 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x + shift 'start at column 1
Next x
next a
next shift
end sub
sub procedure wipein_supra_wipeout_supra
i = 0
a = 0
x = 0
column = 0
shift = 0
value = 0
column = 30 'Calculate the number of columns in the text
for i = 0 to 31 'Temporary array reset
temp_array = 0 'Array elements start out 0
next i
for shift = -32 to column
for i = 0 to 31
value = i + shift
if(value >= 0) and (value <= column - 1) then
temp_array[i + shift + 1]= supra[value]
' temp_array= supra[value]
end if
if(value > column) then
temp_array[i-1] = 0
end if
next i
'Scanning process
for a = 0 to 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
' ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x '+ shift 'start at column 1
Next x
next a
next shift
end sub
sub procedure string_messages
i = 0
a = 0
column = 0
shift = 0
value = 0
' Calculate the number of columns in the text
column = 262
'reset all 32 columns
for i = 0 to 31
temp_array = 0 'Array elements start out 0
next i
'shift operations
for shift = -32 to column 'prolong spaces to repeat again
'32 columns of supra divided into pieces
for i = 0 to 31
value = i + shift
if(value > 0 ) then
temp_array = 0 ' supra input
end if
if(value >= 0) and (value <= column - 1) then
temp_array = text[value]
end if
if(value > column) then
temp_array = 0
end if
next i
'scanning process
for a = 0 to 70 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'number of columns view
'ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.x = 0
portb = temp_array[x] 'send data to PortB
porta = x 'select the corresponding column
Next x
next a
next shift
end sub
main:
trisb = 0
trisa = 0
portb = 0
porta = 0
cmcon = 7
start:
ClearBit(PORTA, i)
supra_title
scanning_to_left
scanning_to_right
wipein_wipeout
wipein_fadein
string_messages
goto start
end.
To see on my youtube:
https://www.youtube.com/watch?v=MQdfT2_JgZg
PS: The word supra is caused by lightning while shooting video. It is still effect. But on breadboarding does not flashing all times.