金牌会员
 
- 积分
- 1678
- 威望
- 837
- 贡献
- 545
- 兑换币
- 496
- 注册时间
- 2012-11-22
- 在线时间
- 148 小时
|
本帖最后由 龙少3 于 2013-8-9 13:28 编辑
GPIO_SET_8bit(PORTE,0,0xfe);
time_delay_ms(1000);
GPIO_SET_8bit(PORTE,0,0xfd);time_delay_ms(1000);
只这样写可以看到电平的跳变
但写到程序中就不可以了,不知为什么,在高低电平中出现周期很短的类似方波的现象。而且好像跳挑不出来
GPIO_SET_8bit(PORTE,0,0xfe);
a=GPIO_GET_8bit(PORTE,0);
if(a==0xee)
{
time_delay_ms(5);
if(a==0xee)
{
GPIO_SET_8bit(PORTA,14,0xfe);
time_delay_ms(700);
}
}
GPIO_SET_8bit(PORTE,0,0xfd); a=GPIO_GET_8bit(PORTE,0);
if(a==0xed)
{
time_delay_ms(5);
if(a==0xed)
{
GPIO_SET_8bit(PORTA,14,0xfd);
time_delay_ms(700);
}
}
|
|