From aea5f49fcc6592037ae8af43d1c812bca5c1fa584ba5aa1bed0df2f367647e29 Mon Sep 17 00:00:00 2001 From: localhorst Date: Wed, 20 Aug 2025 13:22:53 +0200 Subject: [PATCH] toggle PA3 --- main.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index d9511f6..4e055e4 100644 --- a/main.c +++ b/main.c @@ -1,13 +1,18 @@ -#define F_CPU 5000000UL // 5 MHz #include #include -int main(void) { +#define PA3_SET_MASK 0x08 + +int main(void) +{ + VPORTA.DIR = 0x0; + // Configure PA3 as output (Pin 7 on ATTINY202-SSN) - VPORTA.DIR |= 8; - - while (1) { - VPORTA.OUT ^= 8; // toggle PA3 + VPORTA.DIR |= PA3_SET_MASK; + + while (1) + { + VPORTA.OUT ^= PA3_SET_MASK; // toggle PA3 _delay_ms(500); } }