Help - 8x8 Matrix - Starting with all LED_ON

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ASteveFindley
 
Posts: 4
Joined: Fri Oct 30, 2015 4:24 pm

Help - 8x8 Matrix - Starting with all LED_ON

Post by ASteveFindley »

Hi,

I'm working on a program for the 8x8 matrix I've got most of it written and working but I am having one issue.

I would like to begin the program with all of the LEDs within the matrix on, but I would like to do this before my void loop(). I have tried various methods but none will work outside of the loop. I've searched around and just can't find anything. I did see a fillscreen() in the gfx library but not sure how to use it or if it would work outside of the loop.

Any help would be appreciated.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Help - 8x8 Matrix - Starting with all LED_ON

Post by adafruit_support_rick »

You can set all the pixels in the setup() function.

User avatar
ASteveFindley
 
Posts: 4
Joined: Fri Oct 30, 2015 4:24 pm

Re: Help - 8x8 Matrix - Starting with all LED_ON

Post by ASteveFindley »

When I tried that previously I was getting error codes, I went back and tried it again and now its working. Not sure what I was doing wrong before.

Thanks
Last edited by ASteveFindley on Mon Nov 23, 2015 1:50 pm, edited 1 time in total.

User avatar
ASteveFindley
 
Posts: 4
Joined: Fri Oct 30, 2015 4:24 pm

Re: Help - 8x8 Matrix - Starting with all LED_ON

Post by ASteveFindley »

I thought of something else that would be nice to add into the code if its possible. Can the LEDs in the matrix be made to ramp up and down as they are turned on and off?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Help - 8x8 Matrix - Starting with all LED_ON

Post by adafruit_support_rick »

You can use the setBrightness function. It takes a value between 0 (off) and 15 (full on)

Code: Select all

  // brighten
  for (int i = 0; i <= 15; i++)
  {
    setBrightness(i);
    delay(50);
  }
  //darken
  for (i = 15; i >= 0; i--)
  {
    setBrightness(i);
    delay(50);
  }

User avatar
ASteveFindley
 
Posts: 4
Joined: Fri Oct 30, 2015 4:24 pm

Re: Help - 8x8 Matrix - Starting with all LED_ON

Post by ASteveFindley »

Now why didn't I think about using setBrightness() like that, now I feel a lil dumb, lol.

Thanks for the help

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”