title: Can I simplify my C code for checking if the pin is set?
body: <p>The first pin of PortD is HIGH at the beginning. When the first 4 pins of PortA are HIGH, set the second pin of PORTD HIGH, and the first LOW.</p>
  <pre><code> `PORTD=0b00000001;
        
        if (PINA &amp; (1&lt;&lt;0))
        {
            if (PINA &amp;(1&lt;&lt;1))
            {
                if(PINA &amp;(1&lt;&lt;2))
                {
                    if(PINA &amp;(1&lt;&lt;3))
                    {
                        PORTD=0b00000001;
                    }
                }
            }
        }`
  </code></pre>