I'm using hi-tech c compiler.
I was able to use ic prog to load the hex file that was created don't know if that is the correct way of using it but that's how i did it.
I was able to use ic prog to load the hex file that was created don't know if that is the correct way of using it but that's how i did it.
Rich (BB code):
#include <htc.h> // Required to interface with delay routines
#ifndef _XTAL_FREQ
// Unless already defined assume 4MHz system frequency
// This definition is required to calibrate __delay_us() and __delay_ms()
#define _XTAL_FREQ 4000000
#endif
void pause_1(void);
unsigned int i;
main(void)
{
while(1)
{
PORTB = (0b00000001); //turn blue on
pause_1(); //wait 5 secs 5000 ms
PORTB = (0b00000010); //turn red on - blue off
pause_1(); //wait 5 secs 5000 ms
PORTB = (0b00000100); //turn white on - red off
pause_1(); //wait 5 secs 5000 ms
PORTB = (0b00000000); //turn white off
pause_1(); //wait 5 secs 5000 ms
PORTB = (0b00000111); //turn red, white, blue on
pause_1(); //wait 5 secs 5000 ms
PORTB = (0b00000000); //turn red, white, blue off
pause_1(); //wait 5 secs 5000 ms
};
}
void pause_1()
{
for(i=0;i<40;i++)
{
__delay_ms(125); //delay 1000 ms (1 sec)
};
}