#include <htc.h>
#ifndef _XTAL_FREQ
#define _XTAL_FREQ 4000000
#endif
void main(void){
TRISIO = 0xFA;
OSCCON = 0x61; //4MHz Internal OSC
while(1){
__delay_ms(125);__delay_ms(125);__delay_ms(125);__delay_ms(125); //500ms delay
GPIO = 0x04;
__delay_ms(125);__delay_ms(125);__delay_ms(125);__delay_ms(125); //500ms delay
GPIO = 0x00;
}
}
多谢 |