Declaring DDRA and PORTA on Arduino Mega

Right now, I'm trying to output as a grouping of pins (22-29) as PORTA, but when I use the following lines:

DDRA = B11111111; PORTA = 127;

I get an error saying that neither DDRA or PORTA has been declared...I feel like I've looked everywhere, and I can't find the syntax or the proper usage for these ports...

(working on an arduino mega 2560 by the way)


void setup(){
  DDRA = B11111111;
  PORTA = 127;
void loop(){}

Compiles ok for Mega/Mega ADK in 1.0.6 for me.

it's giving me this error now: expected unqualified-id before 'volatile'

However, it compiles fine when I comment out DDRA = B11111111;

Post your whole code. Maybe missing a ) or } elsewhere.

did you include Arduino.h ?