I have a 7 x 7 grid of LED's in a two layered board. The top layer takes all the negatives in each column and the bottom layer takes all the positives in each row. Therefore any LED can be lit by making a pin low and another high.
I'm using a 40X and the positives are connected to the portc outputs:
Row 1 = portc 1
Row 2 = portc 2
Row 3 = portc 3
Row 4 = portc 4
Row 5 = portc 5
Row 6 = portc 6
Row 7 = portc 7
The negative are connected odly because some of the output pins had to be used elseware (not seen in attached code):
Column 1 = portc 0
Column 2 = out 2
Column 3 = out 3
Column 4 = out 4
Column 5 = out 5
Column 6 = out 6
Column 7 = out 7
This is the code to light all the LED's:
Now, whichever "high portc" I put HERE, that row is brighter. i.e. whichever is last shines brightest.
It is purely to do with order.
Is there a reason for this?
I'm using a 40X and the positives are connected to the portc outputs:
Row 1 = portc 1
Row 2 = portc 2
Row 3 = portc 3
Row 4 = portc 4
Row 5 = portc 5
Row 6 = portc 6
Row 7 = portc 7
The negative are connected odly because some of the output pins had to be used elseware (not seen in attached code):
Column 1 = portc 0
Column 2 = out 2
Column 3 = out 3
Column 4 = out 4
Column 5 = out 5
Column 6 = out 6
Column 7 = out 7
This is the code to light all the LED's:
Code:
main: low 2
low 3
low 4
low 5
low 6
low 7
low portc 0
high portc 7
high portc 1
high portc 2
high portc 3
high portc 4
high portc 5
high portc 6 'HERE
goto main
It is purely to do with order.
Is there a reason for this?