论坛元老
 
- 积分
- 3529
- 金钱
- 3529
- 注册时间
- 2020-5-24
- 在线时间
- 230 小时
|
1金钱
本帖最后由 wfx777888 于 2020-11-24 21:36 编辑
请问STM32F103怎样实现八个按键输入控制八个IO输出
#define GPIO_KEY1_CLK RCC_APB2Periph_GPIOA//LOCKíˉËø1ÏTλB9
#define GPIO_KEY1_PORT GPIOA
#define GPIO_KEY1_PIN GPIO_Pin_0
#define GPIO_KEY2_CLK RCC_APB2Periph_GPIOA//LIGHTμÆ1a2ÏTλB8
#define GPIO_KEY2_PORT GPIOA
#define GPIO_KEY2_PIN GPIO_Pin_1
#define GPIO_KEY3_CLK RCC_APB2Periph_GPIOA//UVé±¾ú3ÏTλB7
#define GPIO_KEY3_PORT GPIOA
#define GPIO_KEY3_PIN GPIO_Pin_3
#define GPIO_KEY4_CLK RCC_APB2Periph_GPIOA//WET¼óêa4ÏTλB6
#define GPIO_KEY4_PORT GPIOA
#define GPIO_KEY4_PIN GPIO_Pin_11
#define GPIO_KEY5_CLK RCC_APB2Periph_GPIOA//¿a1ØÏTλB5
#define GPIO_KEY5_PORT GPIOA
#define GPIO_KEY5_PIN GPIO_Pin_7
#define GPIO_KEY6_CLK RCC_APB2Periph_GPIOB//¿a1Ø1ÏTλA15
#define GPIO_KEY6_PORT GPIOB
#define GPIO_KEY6_PIN GPIO_Pin_4
#define GPIO_KEY7_CLK RCC_APB2Periph_GPIOA//¿a1Ø2ÏTλA9
#define GPIO_KEY7_PORT GPIOA
#define GPIO_KEY7_PIN GPIO_Pin_5
#define GPIO_KEY8_CLK RCC_APB2Periph_GPIOB//¿a1Ø3ÏTλA8
#define GPIO_KEY8_PORT GPIOA
#define GPIO_KEY8_PIN GPIO_Pin_6
#define MAX_KEY 8
#define PRESS_KEY1 0x01
#define PRESS_KEY2 0x02
#define PRESS_KEY3 0x04
#define PRESS_KEY4 0x08
#define PRESS_KEY5 0x03
#define PRESS_KEY6 0x05
#define PRESS_KEY7 0x06
#define PRESS_KEY8 0x09
为啥678按键不好用 12345按键能用
高手帮忙看看
|
|