Add Code for a Pullup on PC7

Code for enabling a pull-up on Port C, Pin 7, will be added to the source code. The View IO window is helpful in locating the correct register selection.

Figure 4-28. View IO Window
#include <avr/io.h>

int main(void) {
    
    PORTC.PIN7CTRL = PORT_PULLUPEN_bm; /* Enable PC7 Pullup */
    PORTC.DIR = PIN6_bm; /* Turn on LED */

    while (1) {
    }
}

Program the part

to see the better response of the PC7 switch (GPIO 0) and the turning on of the PC6 LED (GPIO 1).