PDA

View Full Version : Help led matrix



mosbc69
- 14th April 2008, 18:22
Hi to all,
I'm a newbie in PIC programming , someone know the PICBASIC PRO code to make this with
a pic 16f84a?

http://ca.youtube.com/watch?v=cBqXKFL7V7c

I try to make this but don't work.

Thank and sorry for my enlish

skimask
- 14th April 2008, 18:31
I try to make this but don't work.
Post your code...
A schematic might help too...
Just a thought...

duncan303
- 14th April 2008, 18:39
Hi mosbc69


I try to make this but don't work.

How far have you got already with this project?

do you have the circuit built?

rgds

Duncan

mosbc69
- 14th April 2008, 18:52
This is the code:

TRISA=%00000000
TRISB=%00000000

PORTA=%00000000
PORTB=%00000000
x var byte
z var byte



X=0



start:


gosub scan
portA=%00000001
PORTb=z
PAUSEus 150

x= x+1

gosub scan
portA=%00000010
PORTb=z
PAUSEus 150

x= x+1

gosub scan
portA=%00000100
PORTb=z
PAUSEus 150

x= x+1

gosub scan
portA=%00001000
PORTb=z
PAUSEus 150

x= x+1

gosub scan
portA=%00010000
PORTb=z
PAUSEus 150

IF x>4 then X=0


GOTO START

scan:
lookup x,[$60,$50,$48,$47,$40],z
return

With this code i can show the character (in this case the number 7) but i can't move it
from right to left.

skimask
- 14th April 2008, 18:59
TRISA=0:TRISB=0:PORTA=0:PORTB=0:x var byte:z var byte:X=0
start: gosub scan:porta=1:portb=z:pauseus 150:x=x+1:gosub scan:porta=2:portb=z
pauseus 150:x=x+1:gosub scan:porta=4:portb=z:pauseus 150:x=x+1:gosub scan
porta=8:portb=z:pauseus 150:x=x+1:gosub scan:porta=16:portb=z:pauseus 150
IF x>4 then X=0
GOTO START
scan: lookup x,[$60,$50,$48,$47,$40],z : return

Well, there's nothing in your code to make it slide left to right, up to down, or otherwise...
Think about it. You're displaying 'chunks' of this character. You need to make the 'chunks' appear in different spots.
How could you do that?

mosbc69
- 14th April 2008, 19:16
i know that i must make 'chunks' of character , but after how can i move it ?

skimask
- 14th April 2008, 19:21
i know that i must make 'chunks' of character , but after how can i move it ?
Again, think about it...
If the 1st column chunk gets sent to the 1st column, and the 2nd column chunk gets sent to the 2nd column, and so on and so on......then you have to move the 2nd column chunk to the 1st column chunk, move the 1st column chunk to the 5th column chunk...and so on and so on, until everything is moved over...then display it all over again.
But, you're reading all of your data from a 'fixed' place and displaying it to those same 'fixed' places.

Now how could you possibly change the place where the data is sent without changing the place where you got it from?
Or, how could you change the order in which you read the data to send out without changing the place that you're sending it to?

mosbc69
- 14th April 2008, 19:28
thanks very much,
now i try to do this.
If i have more difficulty can you help me more ?

mister_e
- 14th April 2008, 19:54
Sure, this why the forum exist!