Skip to content

Commit fba901f

Browse files
authored
lab 3 code
1 parent 9420bbb commit fba901f

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

MPLab-3-AryaVaraste.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#include <avr\io.h>
2+
#include <avr\interrupt.h>
3+
#include <util\delay.h>
4+
5+
6+
int main(){
7+
8+
DDRA |= (1<<PA0);
9+
DDRA |= (1<<PA1);
10+
DDRA |= (1<<PA2);
11+
12+
while(1){
13+
_delay_ms(750);
14+
PORTA = 0b00000001;
15+
_delay_ms(750);
16+
PORTA = 0b00000010;
17+
_delay_ms(750);
18+
PORTA = 0b00000100;
19+
_delay_ms(750);
20+
}
21+
return 0;
22+
}
23+
24+
25+
26+
27+
#include<avr\io.h>
28+
#include<avr\interrupt.h>
29+
#include<util\delay.h>
30+
31+
32+
int main(){
33+
34+
DDRA |= (1 << PAO);
35+
36+
while(1){
37+
PORTA |= 1;
38+
_delay_ms(750);
39+
PORTA &= ~(1);
40+
_delay_ms(750);
41+
}
42+
43+
return 0;
44+
}

0 commit comments

Comments
 (0)