Digital read pull up in simulink stm32 nucleo board

4 次查看(过去 30 天)
I have a STM32 nucleo board which has a button connected to 5V, GND and D15 (PD_8 --> pin 15) GPIO configured.
When the button is pressed, I want the on board green LED (PD_5 --> pin 13) to light up. When the button is not pressed the LED should be off.
I know the cabling is right since I managed to implement this in STM32CUBEIDE with written code. However, I am having problems with the implementation in simulink. When I press the button, the LED lights up. When I release the button, the LED stays on. In my CUBEIDE code I configured GPIO_PIN_8 as pull up resistor which solves this problem. How do I include pull up resistors in simulink?
I checked Configuration Parameters: simulink_model/Configuration --> Hardware Implementation --> Target hardware resources but there is no GPIO option.

回答(0 个)

产品


版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by