7 Segment connection and code

Connected the middle pins both at the up and bottom to ground, a,b,c,d,e,f,g are connected to outputs as well. (didn't use any resistor for a,b,c... but GND)

The code is quite straightforward but didn't work don't know why ? At where am I wrong ?

int a = 8;
int b = 9;
int c = 10;
int d = 11;
int e = 12;
int f = 13;
int g = 7;

void setup()
{
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
pinMode(7, OUTPUT);
}
void loop()
{
digitalWrite(a, LOW);
}

Okay I've realised one of the problems.

pinMode declarations had to be as follows

pinMode(a, OUTPUT) and goes like that.

However, still nothing happens.

Did you try setting any of the output pins HIGH?

Are you sure your displays are Common Cathode?

johnwasser:
Did you try setting any of the output pins HIGH?

Are you sure your displays are Common Cathode?

Yes I've tried both High and low

Connected the middle pins both at the up and bottom to ground, ...

Maybe those are not the common pins. You haven't told us anything about the display so we really can't tell.

didn't use any resistor for a,b,c... but GND

Adequate for testing, but not a good solution.

Don