demonic_crow: bought my Arduino card last friday and tested to make the same thing as you. Have a 7-seg display to count. Totally useless but I came up with this code:
const int num_pins = 8; // the number of pins used
const int numPatterns=10; // number of patterns to display
int timer = 1000; // time to next pattern
int pins[] = {2, 3, 4, 5, 6, 7, 8, 9}; // pins used, first one to segment A, second to segment B...
// define all different patterns (numbers) to display
int patterns[numPatterns][num_pins]=
{
{1,1,1,1,1,1,0,0},
{0,1,1,0,0,0,0,0},
{1,1,0,1,1,0,1,0},
{1,1,1,1,0,0,1,0},
{0,1,1,0,0,1,1,0},
{1,0,1,1,0,1,1,0},
{1,0,1,1,1,1,1,0},
{1,1,1,0,0,0,0,0},
{1,1,1,1,1,1,1,0},
{1,1,1,1,0,1,1,0},
};
void setup()
{
int i;
for (i = 0; i < num_pins; i++) // the array elements are numbered from 0 to num_pins - 1
pinMode(pins[i], OUTPUT); // set each pin as an output
}
void loop()
{
int i;
int p;
for (i = 0; i < numPatterns; i++) { // loop through all patterns
for (p = 0; p < num_pins; p++) { // loop through the pin states for pattern
if (patterns[i][p]==1)
{
digitalWrite(pins[p], HIGH); // turning it on
}
else
{
digitalWrite(pins[p], LOW); // turning it off
}
}
delay(timer); // pausing
}
}