Hi, Thanks a lot for these videos. I had a bit of difficulty in figuring out stm32f407 discovery board, your videos made me understand a lot about how to program and understand other kinds of stuff. Thanks a lot :-)
For those who are trying to read the button without cubeMX. Here is a littel example Code which does exactly that: #include "stm32f4xx_hal.h" //Function Prototypes void configPins(void); void _delay_ms(uint32_t); int main(void) { configPins(); //Initialize Inputs and Outputs while(1) { //Is user push butten pressed? if(GPIOA->IDR & 0x01) { GPIOD->ODR |= (1
Hi Sir, i trying to write the low level function for the push button but i stuck in somewhere can u help me to correct my code? Thanks a lot! button= B1_GPIO_Port->ODR ^= 0x0001; //this is the location of GPIO_Pin_0, the blue button on the board called USER GPIOD ->ODR ^= 0x2000; //This is GPIO_Pin_13, the orange LED
I change it to IDR now but the LED totally can not ON. I worried is it becasue i never add the Button into GPIOD? I saw in your video the code by using library will include the myPushButton into the HAL_GPIO_WritenPin but seen like i never add the Button into GPIOD is it due to this reason?
Hi Hassam, The code looks good,, Just double check your Keil Software Components,, make sure you enabled all the required software components,,, I showed how to do that in my 1st tutorial (the LED one, at NoCubeMX part, do watch it). Good luck :))