hi all,
anybody have idea how to run led matrix with flowcode?.simply i want to make message display.
can anybody give simple example program.?
thanks .
nuwan
led matrix
Moderator: Benj
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- Contact:
Re: led matrix
What I did is an array of bytes where each bit represents a single LED.
Let's say you have an 8x8 LED Matrix then I'd do an array of 8 bytes.
I use this array as a "displaybuffer".
Then I turn each row one after the other and send each byte to the display.
I usually use a for loop.
Let's say you connected PORTB (8 pins) and PORTC (8 pins) from PIC 'X'.
PORTB is used to send the data: 1 is on, 0 is off
PORTC selects the row which you want to enable: 0 is on, 1 is off.
You could use an interrupt to display your buffer on the LED Matrix (actually I recommend this).
This way, you can do stuff in the main, like changing the displaybuffer, and each time the interrupt is triggered you write on the LED Matrix.
Nicolas
Let's say you have an 8x8 LED Matrix then I'd do an array of 8 bytes.
I use this array as a "displaybuffer".
Then I turn each row one after the other and send each byte to the display.
I usually use a for loop.
Let's say you connected PORTB (8 pins) and PORTC (8 pins) from PIC 'X'.
PORTB is used to send the data: 1 is on, 0 is off
PORTC selects the row which you want to enable: 0 is on, 1 is off.
Code: Select all
// main
char displaybuffer[8] = {0}:
char row = 0;
// display an 'X'
displaybuffer[0] = 0b10000001;
displaybuffer[1] = 0b01000010;
displaybuffer[2] = 0b00100100;
displaybuffer[3] = 0b00011000;
displaybuffer[4] = 0b00011000;
displaybuffer[5] = 0b00100100;
displaybuffer[6] = 0b01000010;
displaybuffer[7] = 0b10000001;
//main loop
for (row = 0; row < 8; row++)
{
PORTC = ~(1 << row); // shift and invert
PORTB = displaybuffer[row]; // output data
}
//end loop
This way, you can do stuff in the main, like changing the displaybuffer, and each time the interrupt is triggered you write on the LED Matrix.
Nicolas
-
- Posts: 82
- Joined: Thu Jul 29, 2010 10:03 am
- Location: sri lanka
- Has thanked: 24 times
- Been thanked: 4 times
- Contact:
Re: led matrix
hi nicolas.
Thanks.
Now i know the concept.can we do that clean flowcode without c code.because im not much c player.
Can we mask some outputs as a data of port a.then give address from other port.is it possible.
Or givin data same way and scan address by using onther oscillator like 4017 possible.
Thanks.
Nuwan.
Sent from my mobile device.
Thanks.
Now i know the concept.can we do that clean flowcode without c code.because im not much c player.
Can we mask some outputs as a data of port a.then give address from other port.is it possible.
Or givin data same way and scan address by using onther oscillator like 4017 possible.
Thanks.
Nuwan.
Sent from my mobile device.
Electronics for better world.
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- Contact:
Re: led matrix
Hi,
A 4017 is a 10 decade counter if I remember well ...
If so then you'll need to sync your data with the frequency of which the 4017 counts.
This will save you a whole port (assuming you're using an 8x8 LED Matrix).
A 4017 is a 10 decade counter if I remember well ...
If so then you'll need to sync your data with the frequency of which the 4017 counts.
This will save you a whole port (assuming you're using an 8x8 LED Matrix).
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: led matrix
Hello,
There is a good project for creating a 8x8 LED matrix using 1 x 8-bit port and 2 x control lines available from here.
http://adrianus.3x.ro/electronic/zws_co ... lboard.htm
The project is good and works as I have tried it personally but my antivirus is warning about the favicon from this site so take care when visiting.
There is a good project for creating a 8x8 LED matrix using 1 x 8-bit port and 2 x control lines available from here.
http://adrianus.3x.ro/electronic/zws_co ... lboard.htm
The project is good and works as I have tried it personally but my antivirus is warning about the favicon from this site so take care when visiting.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 82
- Joined: Thu Jul 29, 2010 10:03 am
- Location: sri lanka
- Has thanked: 24 times
- Been thanked: 4 times
- Contact:
Re: led matrix
hi ben,
thanks.
have you got any written flowcode for led matrix.
regards
nuwan.
thanks.
have you got any written flowcode for led matrix.
regards
nuwan.
Electronics for better world.
- STibor
- Posts: 263
- Joined: Fri Dec 16, 2011 3:20 pm
- Has thanked: 116 times
- Been thanked: 113 times
- Contact:
Re: led matrix
Not tested. 4*4 led matrix multiplex.
Good luck!
Good luck!
- Attachments
-
- matrix mpx.fcf
- (14.72 KiB) Downloaded 338 times
-
- Posts: 82
- Joined: Thu Jul 29, 2010 10:03 am
- Location: sri lanka
- Has thanked: 24 times
- Been thanked: 4 times
- Contact:
Re: led matrix
hi simphy
Any advise to me? For matrix....
Im new to led projects.
Regards,
Nuwan.
Any advise to me? For matrix....
Im new to led projects.
Regards,
Nuwan.
Electronics for better world.
-
- Posts: 82
- Joined: Thu Jul 29, 2010 10:03 am
- Location: sri lanka
- Has thanked: 24 times
- Been thanked: 4 times
- Contact:
Re: led matrix
hi all, ben,
have youn got any written program for led matrix.
why dont you matrix team dont add the component of that,
regards
nuwan.....
have youn got any written program for led matrix.
why dont you matrix team dont add the component of that,
regards
nuwan.....
Electronics for better world.