Ср июн 05, 2019 12:01:36
Пн авг 26, 2019 22:35:43
Ср авг 28, 2019 09:47:10
Ср авг 28, 2019 13:23:49
Чт авг 29, 2019 14:24:35
Пт авг 30, 2019 21:29:27
Ср июн 10, 2020 12:01:37
Ср июн 10, 2020 13:40:50
Вс июл 05, 2020 12:44:10
Сб окт 24, 2020 01:28:04
Сб окт 24, 2020 09:49:26
Вс мар 13, 2022 17:21:34
Вт апр 05, 2022 21:57:02
Пн апр 11, 2022 10:26:07
Вт апр 19, 2022 12:54:58
//PinB 13 - Ok, PinB 14 - Down, PinB 15 - Up
static void button_init(void){
GPIO_InitTypeDef button_ok =
{.GPIO_Pin = GPIO_Pin_13, .GPIO_Speed = GPIO_Speed_2MHz, .GPIO_Mode = GPIO_Mode_IPU};
GPIO_InitTypeDef button_down =
{.GPIO_Pin = GPIO_Pin_14, .GPIO_Speed = GPIO_Speed_2MHz, .GPIO_Mode = GPIO_Mode_IPU};
GPIO_InitTypeDef button_up =
{.GPIO_Pin = GPIO_Pin_15, .GPIO_Speed = GPIO_Speed_2MHz, .GPIO_Mode = GPIO_Mode_IPU};
GPIO_Init(GPIOB, &button_up);
GPIO_Init(GPIOB, &button_down);
GPIO_Init(GPIOB, &button_ok);
}
button_old=button;
button=GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_13);
if (((button_old!=button)&&(button==0))) {
delay_ms(5);
button=GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_13);
if (((button_old!=button)&&(button==0))) {
delay_ms(5);
button=GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_13);
if (((button_old!=button)&&(button==0))) {
delay_ms(5);
button=GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_13);
if (((button_old!=button)&&(button==0))) {
delay_ms(5);
button=GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_13);
if (((button_old!=button)&&(button==0))) {
Ср апр 20, 2022 12:03:42
Вс ноя 27, 2022 11:51:34
Ср май 17, 2023 10:30:51