/* * Blink program * An C program that blink the led * connected to PA5 of the MidTiny board (ATtiny1614). * * Author: Harley Lara * Create: 03 May 2021 * License: (CC BY-SA 4.0) Attribution-ShareAlike 4.0 International * * This work may be reproduced, modified, distributed, * performed, and displayed for any purpose, but must * acknowledge this project. Copyright is retained and * must be preserved. The work is provided as is; no * warranty is provided, and users accept all liability. * */ #define F_CPU 3333333 #include #include #define LED PIN5_bm // Define LED pin #define DELAY 500 // Define waiting time int main(){ PORTA.DIR |= LED; // Define the led port as output while(true){ PORTA.OUT |= LED; // LED ON _delay_ms(DELAY); // Wait half a second PORTA.OUT &= ~LED; //LED OFF _delay_ms(DELAY); // Wait half a second } return 0; }