port initialization

hi guys… im a new user of arduino… i just want to ask if i can initialize a port?

int portLED = PORTD;
void setup ()
{
portMode(portLED, OUTPUT);
}

void loop()
{
portWrite(portLED,HIGH);
delay(500);
portWrite(portLED,LOW);
delay(500);
}

im trying to compile the code above but i shows some error message :’(… i hope you can help me guys… thank you so much…

There is no arduino command in the form you tried that will write all bits to a port at once. If you need to do this you can use the low level functions for direct port IO. The reference page on port manipulation is a good place to start: http://www.arduino.cc/en/Reference/PortManipulation

ok sir… i’l try it… thank you so much! ;D

Oh, I forgot to mention that there is a link to a good tutorial on bitwise math on that page, its well worth reading this if you need help on working with code that operates on some but not all bits.

Have fun!