-
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
8e57b8a
commit 5b35878
Showing
1 changed file
with
28 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,28 @@ | ||
#include <pic.h> | ||
|
||
__CONFIG(UNPROTECT & LVPDIS & BORDIS & MCLRDIS & PWRTEN & WDTDIS & INTCLK); | ||
|
||
#ifndef _XTAL_FREQ | ||
// Unless already defined assume 4MHz system frequency | ||
// This definition is required to calibrate __delay_us() and __delay_ms() | ||
#define _XTAL_FREQ 4000000 | ||
#endif | ||
|
||
void main(void) | ||
{ | ||
TRISB = 0; | ||
|
||
/* Reset the LEDs */ | ||
PORTB = 0; | ||
|
||
/* Light the LEDs */ | ||
PORTB = 0x5A; | ||
|
||
while(1) | ||
{ | ||
PORTB=0XFF; | ||
__delay_ms(100);// delay for 100 milliseconds | ||
PORTB=0X00; | ||
__delay_ms(100);// delay for 100 milliseconds | ||
} | ||
} |