title: Defining macro to see the pin directions
body: <p>In avr or arduino, I need to pass port name to a function, which must use a macro like:</p>
  
  <pre><code>#define setDDR(a) (DDR ## a)
  </code></pre>
  
  <p>to see the pin directions. What I am trying to do is like:</p>
  
  <pre><code>void setup() {
      Serial.begin(9600);
  
      pinMode(13,OUTPUT);
  
      printToScreen(B);
  }
  
  void loop() {
  
  }
  
  #define setDDR(a) (DDR ## a)
  
  void printToScreen(uint8_t i)
  {
      Serial.println(setDDR(i),BIN);
  }
  </code></pre>
  
  <p>But this code gives me a error like " 'B' was not declared in this scope ".</p>