Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<p18f4550.h>
- #include "delays.h"
- /* COMPILER DIRECTIVES FOR CHIP CONFIGURATION BITS*/
- #pragma config FOSC = HS //INTOSCIO_EC /* Sets the oscillator mode to HS */
- #pragma config WDT = OFF /* Turns the watchdog timer off */
- #pragma config LVP = OFF /* Turns low voltage programming off */
- #pragma config DEBUG = OFF /* Compiles without extra debug code */
- #define _XTAL_FREQ 12000000 //delay_ms change by changing this
- void main(void) {
- TRISD = 0xF0; // PORT B Setting: Set all the pins in port B to Output.
- while (1) {
- LATDbits.LATD0 = 1; // RD-0 to High
- LATDbits.LATD1 = 1; // RD-1 to High
- __delay_ms(50); // Half sec delay
- LATDbits.LATD0 = 0; // RD-0 to LOW
- LATDbits.LATD1 = 0; // RD-1 to LOW
- __delay_ms(50); // Half sec delay
- }
- }
- /* THE END */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement