title: Get pin input without the Arduino Library
body: <p>I am not allowed to use the Arduino Library (or any Library) for this program. How would I check the input of a pin? </p>
  
  <p>I found two different functions: </p>
  
  <p>In Arduino.h:</p>
  
  <pre><code>#define bitRead(value, bit) (((value) &gt;&gt; (bit)) &amp; 0x01)
  </code></pre>
  
  <p>Following digitalRead back to pgmspace.h:</p>
  
  <pre><code>#define __LPM_enhanced__(addr)  \
  (__extension__({                \
      uint16_t __addr16 = (uint16_t)(addr); \
      uint8_t __result;           \
      __asm__ __volatile__        \
      (                           \
          "lpm %0, Z" "\n\t"      \
          : "=r" (__result)       \
          : "z" (__addr16)        \
      );                          \
      __result;                   \
  }))
  </code></pre>
  
  <p>For the first one, I don't know where bit and value come from and I just don't understand the second one at all. </p>