Prerequisites
Workflow
main
loop in
the main.c file with the following code snippet:int main (void)
{
/* Configure SW0 as input */
PORTC.DIRCLR = PIN5_bm;
/* Configure LED0 pin as output */
PORTC.DIRSET = PIN0_bm;
while (1)
{
/* Check the status of SW0 */
/* 0: Pressed */
if (!(PORTC.IN & (PIN5_bm)))
{
/* LED0 on */
PORTC.OUTSET = PIN0_bm;
}
/* 1: Released */
else
{
/* LED0 off */
PORTC.OUTCLR = PIN0_bm;
}
}
}