#include
<p18cxxx.h> #pragma config WDT=OFF // disable watchdog timer #pragma config MCLRE = ON// MCLEAR Pin on #pragma config DEBUG = ON// Enable Debug Mode #pragma config LVP = OFF// Low-Voltage programming disabled (necessary for debugging) #pragma config FOSC = INTOSC_EC // High Speed void main() { // Make all bits of PORTD digital output TRISD = 0x0; PORTD = 0xFF; // Make all bits of PORTB digital output TRISB = 0x0; PORTB = 0x0; while (1) { // Delay unsigned int i = 0xFFFF; while (i>0) i--; // Turn on and off all segments of the seven segment display PORTD = ~PORTD; } } |