#include <xc.h> // include processor files
// Configuration bits for PIC16F877A
#pragma config FOSC = XT // Oscillator Selection
#pragma config WDTE = OFF // Watchdog Timer Enable
#pragma config PWRTE = ON // Power-up Timer Enable
#pragma config BOREN = ON // Brown-out Reset Enable
#pragma config LVP = OFF // Low-Voltage Programming Enable
#pragma config CPD = OFF // Data EEPROM Memory Code Protection
#pragma config WRT = OFF // Flash Program Memory Write Enable
#pragma config CP = OFF // Flash Program Memory Code Protection
#define _XTAL_FREQ 4000000 // Define system clock for delay functions
void main() {
TRISB = 0x00; // Set PORTB as output
while (1) {
PORTB = 0xFF; // Turn on all LEDs on PORTB
__delay_ms(500); // 500 ms delay
PORTB = 0x00; // Turn off all LEDs
__delay_ms(500); // 500 ms delay
}
}
I2luY2x1ZGUgPHhjLmg+IC8vIGluY2x1ZGUgcHJvY2Vzc29yIGZpbGVzCgovLyBDb25maWd1cmF0aW9uIGJpdHMgZm9yIFBJQzE2Rjg3N0EKI3ByYWdtYSBjb25maWcgRk9TQyA9IFhUIC8vIE9zY2lsbGF0b3IgU2VsZWN0aW9uCiNwcmFnbWEgY29uZmlnIFdEVEUgPSBPRkYgLy8gV2F0Y2hkb2cgVGltZXIgRW5hYmxlCiNwcmFnbWEgY29uZmlnIFBXUlRFID0gT04gLy8gUG93ZXItdXAgVGltZXIgRW5hYmxlCiNwcmFnbWEgY29uZmlnIEJPUkVOID0gT04gLy8gQnJvd24tb3V0IFJlc2V0IEVuYWJsZQojcHJhZ21hIGNvbmZpZyBMVlAgPSBPRkYgLy8gTG93LVZvbHRhZ2UgUHJvZ3JhbW1pbmcgRW5hYmxlCiNwcmFnbWEgY29uZmlnIENQRCA9IE9GRiAvLyBEYXRhIEVFUFJPTSBNZW1vcnkgQ29kZSBQcm90ZWN0aW9uCiNwcmFnbWEgY29uZmlnIFdSVCA9IE9GRiAvLyBGbGFzaCBQcm9ncmFtIE1lbW9yeSBXcml0ZSBFbmFibGUKI3ByYWdtYSBjb25maWcgQ1AgPSBPRkYgLy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