Тёмный
No video :(

STM32F4 Discovery board - Keil 5 IDE with CubeMX: Tutorial 2 Push button - Updated Oct 2017 

Mutex Embedded
Подписаться 22 тыс.
Просмотров 37 тыс.
50% 1

This video is an updated tutorial on the Push button or Digital input for the STM32F4 Discovery board.

Опубликовано:

 

22 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@sharathn9672
@sharathn9672 5 лет назад
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 :-)
@med6402
@med6402 4 года назад
sir thanks a lot thisis by far the best stm tutorial i've watched
@mutexembedded2206
@mutexembedded2206 4 года назад
Thanks..enjoy watching
@ExtendedCrasHDay
@ExtendedCrasHDay 6 лет назад
Your videos are so helpful, thank you.
@Reingemurkst
@Reingemurkst Год назад
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
@sanelleric6121
@sanelleric6121 Год назад
So called "bare metal" programming, which can be even improved using defined labels for involved bits.
@malgailany
@malgailany 6 лет назад
It would be interesting to see a software implementation of a button debouncing. Thanks.
@mutexembedded2206
@mutexembedded2206 6 лет назад
Mohammed Algailani Thanks for ur suggestion Mohamed.. I will try highlight this in External Push button interrupt.
@hongyangjiang4976
@hongyangjiang4976 3 года назад
Thank you for asking my question. I think in the demo the LED should be bouncing faster than we can realize.
@satishpatil9325
@satishpatil9325 Год назад
Please always upload high resolution videos sir.
@hussienkazan2590
@hussienkazan2590 6 лет назад
can u show the pushbutton code on keil 5, without using stm32f4cube
@sythanh14
@sythanh14 5 лет назад
You simply have to go to the project and look for the HAL library they have all the codes in there.
@aloysloh2652
@aloysloh2652 4 года назад
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
@mutexembedded2206
@mutexembedded2206 4 года назад
Button must use IDR register not ODR. IDR: Input Data Register ODR: Output Data Register
@aloysloh2652
@aloysloh2652 4 года назад
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?
@mutexembedded2206
@mutexembedded2206 4 года назад
@@aloysloh2652 GPIOA for button on discovery F4 board
@aloysloh2652
@aloysloh2652 4 года назад
@@mutexembedded2206 sorry for typo, My code: Button= B1_GPIO_Port->IDR ^= 0x0001; GPIOA ->IDR ^= 0x8000; did i miss anything in my code?
@twaxr54
@twaxr54 6 лет назад
Do you have a git repository or something with the code available?
@hassamkhan9307
@hassamkhan9307 6 лет назад
Sir, I am having trouble doing it without CubeMX. Even though my code is running without error. Kindly sort it out.
@mutexembedded2206
@mutexembedded2206 6 лет назад
Hassam Khan Hi Khan, I will be happy to look at your main code perhaps, if you would share it with me here :)
@hassamkhan9307
@hassamkhan9307 6 лет назад
Sure Sir. I am sending it here right now. Here it is: #include "stm32f4xx_hal.h" void configureGPIO(void); void msDelay(int msTime); int main(void) { GPIO_PinState push; HAL_Init(); configureGPIO(); while(1) { push = HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0); HAL_GPIO_WritePin(GPIOD, GPIO_PIN_13|GPIO_PIN_14, push); msDelay(100); } } void configureGPIO(void) { GPIO_InitTypeDef GPIO_InitStruct; __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE(); HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15, GPIO_PIN_RESET); GPIO_InitStruct.Pin = GPIO_PIN_0; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); } void msDelay(int msTime) { for(int i=0; i
@mutexembedded2206
@mutexembedded2206 6 лет назад
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 :))
@chandruarul7941
@chandruarul7941 5 лет назад
Hi can u show how to externally clock is setting , ?
@mutexembedded2206
@mutexembedded2206 5 лет назад
Hi, I have shown how to do that in SD card video I think. Check it out.
@DQMedia
@DQMedia 4 года назад
Give me program file
Далее
STM32F4-Discovery and 2 HC-SR04 ultrasonic sensors
13:39
STM32 : Push Button example using STM32CUBE IDE
9:00
I built my own computer. by hand.
13:03
Просмотров 1,2 млн