Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksa012po authored Feb 5, 2023
1 parent 8f29569 commit 34a2ffa
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions C_LED_as_binary_counter/main.c
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++)
{

}
}
}



0 comments on commit 34a2ffa

Please sign in to comment.