高级会员

- 积分
- 841
- 金钱
- 841
- 注册时间
- 2017-7-20
- 在线时间
- 85 小时
|
本帖最后由 王涛_学员 于 2017-7-23 13:23 编辑
#include "delay.h"
#include "led.h"
int main(void)
{
u16 time=1; //Ñóê±ê±¼ä
u8 change=1; //Ñóê±ê±¼ä¼ó¼õÅD¶Ï·û
delay_init(); //Ñóê±oˉêy3õê¼»ˉ
LED_Init(); //3õê¼»ˉLED
while(1)
{
PBout(5)=1;delay_us(time);
PBout(5)=0;delay_us(1732-time);
if(change) time++;
else time--;
if(time>1730)change=0;
if(time==1)change=1;
}
}
|
|