user41309: I'm running a custom firmware on the ATmega16U2 (Switch-Fightstick).
Is it possible to access the digital pins of the UNO from the ATmega16U2?

user40318: There is a 4-pin header JP2 on the board that brings out the following pins from the '16U2
PB4, PB5, PB6, PB7

and the ICSP connector
PB1, PB2, PB3


user368: No, only the ATmega328P has access to the external pins of the Uno. You would need to write code for both the '328P and the '16U2 to communicate the pin values and changes over serial since that is the only channel connecting the MCUs.

41309: <p>I'm running a custom firmware on the ATmega16U2 (Switch-Fightstick).
Is it possible to access the digital pins of the UNO from the ATmega16U2?</p>
 40318: <p>There is a 4-pin header JP2 on the board that brings out the following pins from the '16U2</p>

<pre><code>PB4, PB5, PB6, PB7
</code></pre>

<p>and the ICSP connector</p>

<pre><code>PB1, PB2, PB3
</code></pre>
 368: <p>No, only the ATmega328P has access to the external pins of the Uno. You would need to write code for both the '328P and the '16U2 to communicate the pin values and changes over serial since that is the only channel connecting the MCUs.</p>
