MrDEB
Well-Known Member
trying to figure out how to implement a CONST array as shown here.
Keep getting as syntax error.
Can't be all that hard but trying to find an example of an easy method?
Trying to control a 5x7 LED matrix and using a const arry looks like the easiest way as I need to use the same basic patterns over and over.
Then need to have the LEDs to LOOK like they are staying on (POV)
Keep getting as syntax error.
Can't be all that hard but trying to find an example of an easy method?
Trying to control a 5x7 LED matrix and using a const arry looks like the easiest way as I need to use the same basic patterns over and over.
Then need to have the LEDs to LOOK like they are staying on (POV)
Code:
Device = 18f452
Clock = 20 // 20mhz clock
Include "Utils"
// colum 7 colm 6 colm 5 colm 4 colm 3
Const colm(7) As Word =(%00000001, %00000010, %00000100, %00001000, %00010000,
// colm 2 colm 1
%00100000, %01000000 )
// row 3 on row 2&4 rows 1&5
Const row(3) As Word =( %11011, %10101, %01110 )
Sub RightToLeft()
Dim i As colm(2) Or bits.
For i = 0 To 4
PORTB.Bits(i) = 1
DelayMS(500)
PORTB.Bits(i) = 0
Next
End Sub
[//cpde]