Go Down

Topic: Dim LED Matrix (Read 1 time) previous topic - next topic


Hi. Im using a 8x8 matrix with the Arduino RowColumnScanning example sketch (with slight modification). Its working "fine," but the LED's are MUCH dimmer than they are when they are manually set. Anybody know what's causing this?

Code: [Select]
const int col[8] = {
 [glow]2,3,4,5,6,7,8,9[/glow] };

const int row[8] = {
 [glow]10,11,12,13,16,17,18,19[/glow]  };

int pixels[8][8];          

int x = 5;
int y = 5;

void setup() {
 for (int thisPin = 0; thisPin < 8; thisPin++) {

   pinMode(col[thisPin], OUTPUT);
   pinMode(row[thisPin], OUTPUT);  

   digitalWrite(col[thisPin], HIGH);    

 for (int x = 0; x < 8; x++) {
   for (int y = 0; y < 8; y++) {
     pixels[x][y] = HIGH;

void loop() {


void readSensors() {

 pixels[x][y] = HIGH;

 x = map(analogRead(A0), 0, 1023, 0, 7);
 y =7- map(analogRead(A1), 0, 1023, 0, 7);

 pixels[x][y] = LOW;


void refreshScreen() {

 for (int thisRow = 0; thisRow < 8; thisRow++) {

   digitalWrite(row[thisRow], HIGH);

   for (int thisCol = 0; thisCol < 8; thisCol++) {

     int thisPixel = pixels[thisRow][thisCol];

     digitalWrite(col[thisCol], thisPixel);

     if (thisPixel == LOW) {
       digitalWrite(col[thisCol], HIGH);

   digitalWrite(row[thisRow], LOW);


You forgot to delay after switching the LEDs so you're switching them off again really fast.  Try something like 1ms delay in first instance.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


Thanks for the reply but Im not sure what you mean by first instance

James C4S

You want the lights to stay on for a some amount of time before you shut them back off again.  Your eyes are much (much) slower than the arduino.  You'll be surprised what a small delay like 1ms will do.

Before you turn the ROW off, delay for some amount of time.  Play with this delay to strike a balance between brightness and responsiveness.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131