milan.rajik
Banned
Fill the pattern.
mikroBasic PRO PIC Code.
mikroBasic PRO PIC Code.
Code - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 program matrix ' Declarations section dim i as byte ' inner loop dim j as byte ' outer loop const pattern as byte[30] = (0x3e,0x41,0x41,0x41,0x3e,0x00,) 'letter o for scrolling pattern Sub procedure Reset_Col() porta.f1 = 1 'reset 4017 when i>5 porta.f1 = 0 end Sub Sub procedure advance_Col() porta.f0 = 1 '4017 clock advance porta.f0 = 0 end Sub main: ' Main program TRISA = 0 TRISB = 0 PORTB = 0 WHILE True for j = 0 to 4 'patterns for scrolling Reset_col() 'reset 4017 t0 q0 for i = 0 to 5 '6 bytes per pattern portb = 0 'clear matrix display for flickr and previous pattern PORTB= pattern[jx6+i] 'load pattern to portb based on (i & j)'s values advance_Col() 'advance 4017 clock next i 'next value of i next j 'next pattern WEND end.