LED problem

I remmember once trying to dirrectly drive a seven segment display with my Arduino and the segments were really dim I checked and found that I forgot to put

pinMode(segment, OUTPUT);

!