led matrix

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

nuwan5213
Posts: 82
Joined: Thu Jul 29, 2010 10:03 am
Location: sri lanka
Has thanked: 24 times
Been thanked: 4 times
Contact:

led matrix

Postby nuwan5213 » Sat Dec 17, 2011 2:35 pm

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 :?
Electronics for better world.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times
Contact:

Re: led matrix

Postby Spanish_dude » Sat Dec 17, 2011 3:01 pm

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.

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


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

nuwan5213
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

Postby nuwan5213 » Mon Dec 19, 2011 3:53 am

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.
Electronics for better world.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times
Contact:

Re: led matrix

Postby Spanish_dude » Tue Dec 20, 2011 7:12 pm

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).
These users thanked the author Spanish_dude for the post:
nuwan5213 (Thu Dec 22, 2011 12:55 am)
Rating: 5%
 

User avatar
Benj
Matrix Staff
Posts: 14797
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4759 times
Been thanked: 4362 times
Contact:

Re: led matrix

Postby Benj » Fri Dec 23, 2011 1:40 pm

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.
These users thanked the author Benj for the post:
nuwan5213 (Tue Dec 27, 2011 5:24 am)
Rating: 5%
 

nuwan5213
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

Postby nuwan5213 » Tue Dec 27, 2011 5:24 am

hi ben,

thanks.
have you got any written flowcode for led matrix.

regards
nuwan. 8)
Electronics for better world.

User avatar
STibor
Posts: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: led matrix

Postby STibor » Wed Dec 28, 2011 8:53 pm

Not tested. 4*4 led matrix multiplex.
Good luck!
Attachments
matrix mpx.fcf
(14.72 KiB) Downloaded 186 times
These users thanked the author STibor for the post:
nuwan5213 (Thu Dec 29, 2011 12:52 am)
Rating: 5%
 

nuwan5213
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

Postby nuwan5213 » Thu Dec 29, 2011 12:58 am

hi simphy
Any advise to me? For matrix....
Im new to led projects.
Regards,
Nuwan.
Electronics for better world.

nuwan5213
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

Postby nuwan5213 » Mon Jan 23, 2012 12:55 pm

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..... :|
Electronics for better world.