Skip to content

Commit 7a756e4

Browse files
pic microcontroller
1 parent 1bf47da commit 7a756e4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pic microcontroller

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <xc.h>
2+
#define _XTAL_FREQ 20000000 //Specify the XTAL crystal FREQ
3+
void main() //The main function
4+
{
5+
TRISB=0X00; //Instruct the MCU that the PORTB pins are used as Output.
6+
PORTB=0X00; //Make all output of RB3 LOW
7+
while(1) //Get into the Infinite While loop
8+
{
9+
RB3=1; //LED ON
10+
__delay_ms(500); //Wait
11+
RB3=0; //LED OFF
12+
__delay_ms(500); //Wait
13+
//Repeat.
14+
}
15+
}

0 commit comments

Comments
 (0)