Test sketch

Hi, I'm a super beginner about programming. I made a 10x10 Led Matrix and now I want to test if it works or not. For test I need the sketch for lighting led one by one in order to avoid burn out. So I'd like to know how I can make this sketch. I really appreciate if someone help me.

for (byte i = 0 ; i < 10 ; i++) {
  for (byte j = 0 ; j < 10 ; j++) {
    //Test here
  }
}

Jacques

kimutakuro: Hi, I'm a super beginner about programming. I made a 10x10 Led Matrix and now I want to test if it works or not. For test I need the sketch for lighting led one by one in order to avoid burn out. So I'd like to know how I can make this sketch. I really appreciate if someone help me.

Presumably you don't have each LED connected to its own pin so how are they connected. Have you got them connected to the Arduino and if so, which one ?

UKHeliBob:
Presumably you don’t have each LED connected to its own pin so how are they connected. Have you got them connected to the Arduino and if so, which one ?

I just wired all leds together(10x10) and then connected with Arduino (D2, DND, 5V)
I tested each rows by using the sketch below that makes light up at the same time and it worked but I don’t know how to make a code for lightning one by one for whole matrix.

// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library

#include <Adafruit_NeoPixel.h>
#ifdef AVR
#include <avr/power.h>
#endif

// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN 2

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 10

// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter–see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int delayval = 500; // delay for half a second

void setup() {
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (AVR_ATtiny85)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
// End of trinket special code

pixels.begin(); // This initializes the NeoPixel library.
}

void loop() {

// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.

for(int i=0;i<NUMPIXELS;i++){

// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(150,150,0)); // Moderately bright green color.

pixels.show(); // This sends the updated pixel color to the hardware.

delay(delayval); // Delay for a period of time (in milliseconds).

}
}

#define NUMPIXELS      10

A 10x10 array of leds is 100 leds

#include <Adafruit_NeoPixel.h>

So these turn out to be NeoPixel LEDs

How is the matrix laid out ? Is it a zigzag or is the next LED after the end of each row at the start of the next one ?

Have a look at NeoMatrix Library | Adafruit NeoPixel Überguide | Adafruit Learning System