Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (1)
- {
- /* USER CODE END WHILE */
- int estado = HAL_GPIO_ReadPin(Bt1_GPIO_Port, Bt1_Pin); //Declaramos una variable y lo igualamos a la lectura del pin del
- // pin Bt1
- if ( estado == 1 ) { // Si estado es igual a 1 apagamos el led y si es igual a 0 lo encendemos
- HAL_GPIO_WritePin(Ld2_GPIO_Port, Ld2_Pin, GPIO_PIN_RESET);
- } else {
- HAL_GPIO_WritePin(Ld2_GPIO_Port, Ld2_Pin, GPIO_PIN_SET);
- }
- /* USER CODE BEGIN 3 */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement