We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi everyone,
I'm a begginner and i'm trying to display a "DO" on my STM32L-Discovery board (STM32L152). In order to do so, I tried to connect the button to the pin PA11. Nevertheless, it doesn't work.
Here is my code :
int main(void) /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_LCD_Init(); MX_DAC_Init(); /* USER CODE BEGIN 2 */ BSP_LCD_GLASS_Init(); BSP_LCD_GLASS_BarLevelConfig(0); BSP_LCD_GLASS_Clear(); // PA11 as digital input(00) GPIOA->PUPDR &= ~(1 << (11*2 +1)); GPIOA->PUPDR |= (1 << (11*2)); /* USER CODE END 2 */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ if ((GPIOA->IDR&(0X0000000B)==0)) { while ((GPIOA->IDR&0X0000000B)==0) { BSP_LCD_GLASS_DisplayString((uint8_t *)"DO"); wait(70000); } BSP_LCD_GLASS_Clear(); } /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ } <\pre> Does anyone have a idea to solve this problem ? Thanks in advance :)
Always a good plan!
And learn to use the debug tools on those examples.
www2.keil.com/.../learn
Support, examples, etc for the STM32L-DISCOVERY and 32L152CDISCOVERY kits here: www.st.com/.../32l152cdiscovery.html
ST have their own YouTube channel, with lots of STM32 learning material: www.youtube.com/.../UCjnmZw3h4XnpK3e5D2jvIGA
And learning site: www.st.com/.../stm32-education.html
See also: http://community.st.com/