新手上路
- 积分
- 33
- 金钱
- 33
- 注册时间
- 2016-6-4
- 在线时间
- 3 小时
|
3金钱
int main(void)
{ delay_init(168);
led_init();
while(1)
{ if ((GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_0 ))|(GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_2 ))|(GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_3 ))|(GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_4 )))
{
if (GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_2))GPIO_SetBits(GPIOF,GPIO_Pin_8 );
else if (GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_3))GPIO_ResetBits(GPIOF,GPIO_Pin_9 );
else if (GPIO_ReadInputDataBit(GPIOE,GPIO_Pin_4))GPIO_ResetBits(GPIOF,GPIO_Pin_10 );
else if (GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_0))GPIO_ResetBits(GPIOF,GPIO_Pin_9 |GPIO_Pin_10);
}
else {GPIO_ResetBits(GPIOF,GPIO_Pin_8 );GPIO_SetBits(GPIOF,GPIO_Pin_9 |GPIO_Pin_10);}
}
}
|
|