#include <htc.h>
//__CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDT_OFF & FOSC_HS);
/*
Low Voltage Programming Disabled (LVP_OFF)
Brown Out Reset Disabled (BOREN_OFF)
Power Up Timer Enabled (PWRTE_ON)
Watchdog Timer Disabled (WDT_OFF)
High Speed Crystal Oscillator (FOSC_HS)
*/
#define _XTAL_FREQ 4000000
// function prototype (every function must have a function prototype)
//==========================================================================
void delay(unsigned long data);
// main function (main fucntion of the program)
//==========================================================================
void main()
{
unsigned long delay_time=5000;
//set I/O input output
TRISD = 0x00; //configure PORTB Output direction
PORTD = 0x00;
//set I/O input output
TRISB = 0b11000000; //configure PORTB I/O direction
while(1) //Infinite loop
{
PORTD = 0x00 ;
delay_time=1000; //delay
PORTD = 0xFF ;
delay_time=1000; //delay
}
}
// functions
//==========================================================================
void delay(unsigned long data) //delay function, the delay time
{ //depend on the given value
for( ;data>0;data--);
}
LED-blink.rar_blink
版权申诉
77 浏览量
2022-09-19
20:20:09
上传
评论
收藏 40KB RAR 举报
小波思基
- 粉丝: 74
- 资源: 1万+
最新资源
- 纯 PHP 开发的并行抓取工具 (Parallel web crawler written in PHP)
- 基于Vue的云视讯入住解决方案设计源码
- 对人脸图像进行性别和年龄的判断
- Go语言开发的端口转发工具 for port data forward (TavenLi)
- 无限弹窗的各种常用代码(cpp和bat)
- FME模板演示:DLG转成dwg数据,还原地物样式
- R language bioinformatics analysis package wrapper for VisualBas
- 基于Keras的LSTM多变量时间序列预测python源码+文档说明
- 基于Keras+LSTM多变量时间序列预测Python源码+文档说明.zip
- FME模板演示:提取CAD扩展属性,以提取地物编码为例
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈