-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f29569
commit 34a2ffa
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* C_LED_as_binary_counter.c | ||
* | ||
* Created: 20.11.2022. 22:28:39 | ||
* Author : Aleksandar Bogdanovic | ||
*/ | ||
|
||
#define F_CPU 16000000UL // Defined clock at 16MHz | ||
|
||
#include <avr/io.h> | ||
#include <stdint.h> | ||
#include <util/delay.h> | ||
|
||
void delay(int time); | ||
|
||
int main(void) { | ||
DDRD = 0xFF; | ||
PORTD = 0; | ||
|
||
while(1) { | ||
PORTD ++; | ||
_delay_ms(100); | ||
} | ||
} | ||
|
||
void delay(int time) { | ||
int i, j; | ||
for(i = 0; i <= time; i++) | ||
{ | ||
for(j = 0; j < 23; j++) | ||
{ | ||
|
||
} | ||
} | ||
} | ||
|
||
|
||
|