How detect a rising edge ?
Hi,
I have a school projet about preventive maintenance on WC. Due to the COVID-19, we no longer have access to the material, but we have to try to continue the project.
We use a turbine which is connected to the water access (in the WC) and it will be connect to the Arduino shield (PA0) link to our uC "b-l072z-lrwan1" (STM32L0). We only use our uC to check the data of the turbine and send it to The Thing Network.
We want that when a flush was used our uC run a code while the WC is filling up and depending on the time to refill it, sent an error.
I learned that we need to enable the clock of the pin, after configure the GPIO, but I can't remember what I have to do next.
void Turbine_Init(){
GPIO_InitTypeDef GPIO_InitStruct;
RCC_GPIO_CLK_ENABLE(GPIOA);
GPIO_InitStruct.Pin = GPIO_PIN_A0;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
}Thank you !
