新手入门
- 积分
- 19
- 金钱
- 19
- 注册时间
- 2018-4-9
- 在线时间
- 2 小时
|

楼主 |
发表于 2018-4-10 16:03:53
|
显示全部楼层
void KEY_Init(void) //IO3õê¼»ˉ
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOE,ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOE, &GPIO_InitStructure);
}
I/O口配置 ,输入方式参照按键,由于是新手 还不太理解 各种输入方式都尝试了。
while(1)
{
if(!GPIO_ReadOutputDataBit(GPIOE, GPIO_Pin_0))
{
LED0=!LED0;
}
}
这是主函数,我只能写成这样
求大神们帮看看 改怎么完成这个简单的功能 .....这个模块好像不太复杂 网上可参考的资料不太多 跪谢 |
|