/* modified ACKBK 7.2 for 3x3RA
- changed microSeconds to delay(100)
*can see seqnential blinking but not fromn upper L corner
*to lower R corner. Starts in upper L corner
*goes to first two LEDs then back to first, then the entire 1st column etc - matrixMpx sketch
- Sequence LEDs starting from first column and row until all LEDS are lit
- Multiplexing is used to control 64 LEDs with 16 pins
*/
const int columnPins[] = {8, 9, 10};
const int rowPins[] = {5, 6, 7};
int pixel = 0; // 0 to 63 LEDs in the matrix
int columnLevel = 0; // pixel value converted into LED column
int rowLevel = 0; // pixel value converted into LED row
void setup() {
for (int i = 0; i < 3; i++)
{
pinMode(columnPins*, OUTPUT); // make all the LED pins outputs*
_ pinMode(rowPins*, OUTPUT);_
_ }_
_}_
void loop() {
_ pixel = pixel + 1;_
_ if(pixel > 8)_
_ pixel = 0;_
_ columnLevel = pixel / 3; // map to the number of columns*_
* rowLevel = pixel % 3; // get the fractional value*
* for (int column = 0; column < 3; column++)*
* {*
* digitalWrite(columnPins[column], LOW); // connect this column to Ground*
* for(int row = 0; row < 3; row++)*
* {*
* if (columnLevel > column)*
* {*
* digitalWrite(rowPins[row], HIGH); // connect all LEDs in row to +5 volts*
* }*
* else if (columnLevel == column && rowLevel >= row)*
* {*
* digitalWrite(rowPins[row], HIGH);*
* }*
* else*
* {*
* digitalWrite(columnPins[column], LOW); // turn off all LEDs in this row*
* }*
* delay(100);*
* //delayMicroseconds(800000); // delay gives frame time of 20ms for 64 LEDs*
* digitalWrite(rowPins[row], LOW); // turn off LED*
* }*
* digitalWrite(columnPins[column], HIGH); // disconnect this column from GND*
* }*
}
*SECOND REPLY: *
Please see the update at the bottom of my original message. The question now is: does the pattern I describe match this code ? If so, we're OK.
I also found that using the CTRL keys was easier for copying the code. The select/copy method didn't work for me -- it just produced more brackets. Thanks for getting back to me so quickly.