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.
Help - 8x8 Matrix - Starting with all LED_ON
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- ASteveFindley
- Posts: 4
- Joined: Fri Oct 30, 2015 4:24 pm
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Help - 8x8 Matrix - Starting with all LED_ON
You can set all the pixels in the setup() function.
- ASteveFindley
- Posts: 4
- Joined: Fri Oct 30, 2015 4:24 pm
Re: Help - 8x8 Matrix - Starting with all LED_ON
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
Thanks
Last edited by ASteveFindley on Mon Nov 23, 2015 1:50 pm, edited 1 time in total.
- ASteveFindley
- Posts: 4
- Joined: Fri Oct 30, 2015 4:24 pm
Re: Help - 8x8 Matrix - Starting with all LED_ON
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?
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Help - 8x8 Matrix - Starting with all LED_ON
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);
}
- ASteveFindley
- Posts: 4
- Joined: Fri Oct 30, 2015 4:24 pm
Re: Help - 8x8 Matrix - Starting with all LED_ON
Now why didn't I think about using setBrightness() like that, now I feel a lil dumb, lol.
Thanks for the help
Thanks for the help
Please be positive and constructive with your questions and comments.