初级会员

- 积分
- 150
- 金钱
- 150
- 注册时间
- 2012-3-18
- 在线时间
- 0 小时
|

楼主 |
发表于 2012-3-31 22:25:31
|
显示全部楼层
回复【4楼】正点原子:
---------------------------------
while(1)
{
if(!PAin(13))
{
delay(2000);
if(!PAin(13))
{
PAout(8)=0; // 这里使用了位带操作,也可以使用 GPIO_ResetBits(GPIOA,GPIO_Pin_8);
  Dout(2)=1;
delay(5000); // 也可以使用 GPIO_SetBits(GPIOD,GPIO_Pin_2);
}
}
if(!PAin(15))
{
delay(2000);
if(!PAin(15))
{
PDout(2)=0;
PAout(8)=1;
delay(5000);
}
}
if(!PAin(0))
{
delay(2000);
if(!PAin(0))
{
PAout(8)=!PAout(8);
PDout(2)=!PDout(2);
delay(5000) ;
}
}
}
}
只能这样用吗 下载代码后 怎么等不停的亮灭呢 就不受按键的控制呢 |
|