Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <xc.h>
- #pragma config FOSC = INTOSCIO // Oscillator Selection bits (HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN)
- #pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
- #pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
- #pragma config MCLRE = OFF // RA5/MCLR/VPP Pin Function Select bit(RA5/MCLR/VPP pin function is MCLR)
- #pragma config BOREN = OFF // Brown-out Detect Enable bit (BOD disabled)
- #pragma config LVP = OFF // Low-Voltage Programming Enable bit(RB4/PGM pin has digital I/O function, HV on MCLR must be used forprogramming)
- #pragma config CPD = OFF // Data EE Memory Code Protection bit (Datamemory code protection off)
- #pragma config CP = OFF // Flash Program Memory Code Protection bit(Code protection off)
- #define _XTAL_FREQ 4000000
- #define A RB0
- #define B RB1
- #define C RB2
- #define D RB3
- #define E RB4
- #define F RB5
- #define G RB6
- #define H RB7
- #define I RA0
- #define J RA1
- #define K RA2
- #define L RA3
- #define M RA4
- #define N RA5
- #define O RA6
- #define P RA7
- void main (){
- PORTB=0x00;
- PORTA=0x00;
- TRISB=0x00;
- TRISA=0x00;
- while(1){
- A = 1;
- __delay_ms(1000);
- B = 1;
- __delay_ms(1000);
- C = 1;
- __delay_ms(1000);
- D = 1;
- __delay_ms(1000);
- E = 1;
- __delay_ms(1000);
- F = 1;
- __delay_ms(1000);
- G = 1;
- __delay_ms(1000);
- H = 1;
- __delay_ms(1000);
- I = 1;
- __delay_ms(1000);
- J = 1;
- __delay_ms(1000);
- K = 1;
- __delay_ms(1000);
- L = 1;
- __delay_ms(1000);
- M = 1;
- __delay_ms(1000);
- N = 1;
- __delay_ms(1000);
- O = 1;
- __delay_ms(1000);
- P = 1;
- __delay_ms(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement