supra_2010
Member
program MikroBasic_Messages
' * Description: Scrolled to left
' *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:
YouTube - Scrolling Text
' * Description: Scrolled to left
' *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:
YouTube - Scrolling Text