#include<p18f4520.h>
#pragma config XINST = OFF
#pragma config LVP=OFF
#pragma config OSC=HS
#pragma config WDT=OFF// Use internal Oscillator, Watchdog off, LVP off
#pragma config MCLRE = ON // Extended instruction set on
void delay (void)
{
int i;
for (i = 0; i < 10000; i++)
;
}
void main (void)
{
/* Make all bits on the Port B (LEDs) output bits.
* If bit is cleared, then the bit is an output bit.
*/
TRISD = 0;
while (1)
{
/* Reset the LEDs */
PORTD = 0;
/* Delay so human eye can see change */
delay ();
/* Light the LEDs */
PORTD= 0x5A;
/* Delay so human eye can see change */
delay ();
}
}