led matrix

rob nash

Senior Member
Hello all and good day,
Well my Wednesday project taken a side step it was going to be button press indictor and turned into a led matrix display 5x5 small but workable. Am using five bc38 transistors for the columns and five 260 ohms resistors for the rows, so that’s 25 led for 10 pins.
The bread board setup is 20x2 out pins b.7 to b.3 via 1.5k resistors control the transistors and c.0 to c.4 connect to the resistors controls the rows and it works! But as I start writing the code its becoming clear that its way to lengthy am sure it a case of “let pinsb = %11111000, let pinsc = %00000001, and its here I have such mental block getting started. Does anyone have a similar setup that I may have peep at the code used” cheeky but helpful”. OR would someone be kind and offer me a helpful start I would so like to get the led’s to trickle down like in the film “matrix” where the code on the screen trickles down.
Code:
symbol abit = 100

symbol col1 = b.7
symbol col2 = b.6
symbol col3 = b.5
symbol col4 = b.4
symbol col5 = b.3

symbol row1 = c.0
symbol row2 = c.1
symbol row3 = c.2
symbol row4 = c.3
symbol row5 = c.4



main:do 
      high col1  
      pause abit
       high row1
       low  row2
       low  row3
       low  row4
       low  row5
       pause abit
        high row1
       high row2
       low  row3
       low  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       low  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       high  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       high  row4
       high  row5
       pause abit
       low col1
       '######################
        high col1
        high col2  
      pause abit
       high row1
       low  row2
       low  row3
       low  row4
       low  row5
       pause abit
        high row1
       high row2
       low  row3
       low  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       low  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       high  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       high  row4
       high  row5
       pause abit
       
       '#################################
        high col1
        high col2  
        high col3
      pause abit
       high row1
       low  row2
       low  row3
       low  row4
       low  row5
       pause abit
        high row1
       high row2
       low  row3
       low  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       low  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       high  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       high  row4
       high  row5
       pause abit
       '#######################################
        high col1
        high col2  
        high col3
        high col4
      pause abit
       high row1
       low  row2
       low  row3
       low  row4
       low  row5
       pause abit
        high row1
       high row2
       low  row3
       low  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       low  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       high  row4
       low  row5
       pause abit
         high row1
       high row2
       high  row3
       high  row4
       high  row5
       pause abit
       '##############################
       
       '#############################################
        high col1
        high col2  
        high col3
        high col4
        high col5
      pause abit
       high row1
       low  row2
       low  row3
       low  row4
       low  row5
       pause abit
        high row1
       high row2
       low  row3
       low  row4
       low  row5
       pause abit
       high row1
       high row2
       high  row3
       low  row4
       low  row5
       pause abit
       high row1
       high row2
       high  row3
       high  row4
       low  row5
       pause abit
       high row1
       high row2
       high row3
       high row4
       high row5
       pause abit
       
       '###############################################
       
       low col1
       low col2  
       low col3
       low col4
       low col5
       
       low row1
       low  row2
       low  row3
       low  row4
       low  row5
      
      
      
       
       
       
       
     loop
i,ll be grateful for any advice on reducing this piece of codeleds 004.JPGleds 007.JPG

cheers rob

@ technical would you be getting 20x4 red oleds?
 

Haku

Senior Member
This should get you started on how pinsb relates to high & low commands:

let pinsb = %00011111

is the same as

high b.0
high b.1
high b.2
high b.3
high b.4
low b.5
low b.6
low b.7
 

westaust55

Moderator
Another option is to store the data in EEPROM or since you have an X2 part even TABLE memory.
Then calculate the offset to the locations for the next data to be READ and passed to the port PINS.

Edit:
All you need then is a looping structure to fetch the next data for row and column pass it to the PINS and after a pause (if needed) return to the start of the loop.
Using DO...LOOP or similar is ideal.
 
Last edited:

rob nash

Senior Member
Hello all,
While searching the web over the weekend for info on flashing led’s, I discovered multiplexing and came across the Ytube video http://www.youtube.com/watch?v=lZyc6ulpkyMwhich is very helpful in explaining what multiplexing is. Need to get some more transistors as I did notice the led’s fade a lot when I got them all on using multiplexing.
Cheers rob

O its going to be a plexing day

@Texasclodhopper didn’t realise the pics where out of focus at the time and never looked will upload clearer pics for your scrapbook if I come up with a useful project for the leds.
 
Top