From fec505240f22065aaea2ee80c1082cad136559bb Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Mon, 26 Feb 2024 00:46:09 -0600 Subject: Initial commit --- Example01/main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Example01/main.c (limited to 'Example01/main.c') diff --git a/Example01/main.c b/Example01/main.c new file mode 100644 index 0000000..76a47b2 --- /dev/null +++ b/Example01/main.c @@ -0,0 +1,14 @@ +#define F_CPU 3333333 +#include +#include + +int main(void) { + PORTF.DIR &= ~PIN3_bm; // button as input + PORTF.DIR |= PIN4_bm; // green as output + PORTF.DIR |= PIN5_bm; // red as output + + while (1) { + bool buttonp = PORTF.IN & PIN3_bm; + PORTF.OUT = 1 << (buttonp ? PIN4_bp : PIN5_bp); + } +} -- cgit v1.2.3