Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Scrolling vertical messages

Status
Not open for further replies.
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
 
scrolling vertical messages up

scrolling vertical messages up

* Project name:
' vertical_messages_up
' ' ' * Description:
' This code demonstrates scrolling vertical messages up
' 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_up

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 up 8x32 dot matrix
 
scrolling vertical messages down from centre to left

scrolling vertical messages down from centre to left

* Project name:
' vertical_down_centre_to_left
' ' ' * Description:
' This code demonstrates scrolling vertical down from centre to left
' 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_down_to_left

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 column 'prolong spaces to repeat again

'32 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 = supra[value]
end if

if(value > column) then
temp_array = 0
end if
next i

'Scanning process
for a = 0 to 35 '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] << shift 'send data to PortB
porta = x 'select the corresponding column
Next x
nop
nop
' delay_us(1000)
next a
next shift
wend
goto start
end.

youtube:
YouTube - scrolling vertical messages down from centre to left 8x32 dot matrix
 
scrolling vertical messages down from centre to right

[B]scrolling vertical messages down from centre to right[/B]


Project name:
' vertical_down_centre_to_right
' ' ' * Description:
' This code demonstrates scrolling vertical messages down from centre to right
' 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_down_to_right

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 column 'prolong spaces to repeat again

'32 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 = supra[value]
end if

if(value > column) then
temp_array = 0
end if
next i

'Scanning process
for a = 0 to 35 '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] << shift 'send data to PortB
porta = x 'select the corresponding column
Next x
nop
nop
' delay_us(1000)
next a
next shift
wend
goto start
end.

youtube:
YouTube - scrolling vertical messages down from centre to right 8x32 dotmatrix
 
scrolling vertical messages up from centre to top left

scrolling vertical messages up from centre to top left

roject name:
' vertical_up_from_centre_to_top_left
' ' ' * Description:
' This code demonstrates scrolling vertical messages up from centre to top left
' 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_up_centre_to_top_left

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 column 'prolong spaces to repeat again

'32 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 = supra[value]
end if

if(value > column) then
temp_array = 0
end if
next i

'Scanning process
for a = 0 to 35 '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] >> shift 'send data to PortB
porta = x 'select the corresponding column
Next x
nop
nop
' delay_us(1000)
next a
next shift
wend
goto start
end.



Youyube
YouTube - scrolling vertical messages up from centre to top left 8x32 dot matrix
 
scrolling messages vertical up from bottom to top right

scrolling messages vertical up from bottom to top right

Project name:
' vertical up from centre to top right
' ' ' * Description:
' This code demonstrates scrolling messages vertical up from bottom to top right
' 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_up_centre_to_top_right

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 column 'prolong spaces to repeat again

'32 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 = supra[value]
end if

if(value > column) then
temp_array = 0
end if
next i

'Scanning process
for a = 0 to 35 '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] >> shift 'send data to PortB
porta = x 'select the corresponding column
Next x
nop
nop
' delay_us(1000)
next a
next shift
wend
goto start
end.

youtube:
YouTube - scrolling vertical messages up from centre to top right 8x32 dot matrix
 
Good job. However, you might want to consider editing your posts and using the code tags so it keeps it's formatting. It is so much easier to read when formatted like this,
Code:
Project name:
' vertical up from centre to top right
' ' ' * Description:
' This code demonstrates scrolling messages vertical up from bottom to top right
' 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_up_centre_to_top_right

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[i] = 0 'Array elements start out 0
    next i

    while true
        'Shift operations
        for shift = 0 to column 'prolong spaces to repeat again
        
            '32 columns of text divided into pieces
            for i = 0 to 31
                value = i - shift
                if(value > 0) then
                    temp_array[i] = 0 ' text input
                end if
                
                if(value >= 0) and (value <= column - 1) then
                    temp_array[i] = supra[value]
                end if
                
                if(value > column) then
                    temp_array[i] = 0
                end if
            next i
            
            'Scanning process
            for a = 0 to 35 '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] >> shift 'send data to PortB
                    porta = x 'select the corresponding column
                Next x
                nop
                nop
                ' delay_us(1000)
            next a
        next shift
    wend
goto start
end.

You can use code tags by either,
Typing [code] before your code and [/code] after it.
Or,
Go to the advanced page and use the # button.

Mike.
 
Highlight the code and click the # on the reply bar.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top