I this example we are using Green LED on our stem32f4 Discovery Board. It will turn on, once the
push Button is pressed.
Steps:
1. Enable clock for LED:
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
2. Enable clock for push Button:
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
3. Configure Pins (LED and push Button)
4. We can then use the LED and Button
Example:
push Button is pressed.
Steps:
1. Enable clock for LED:
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
2. Enable clock for push Button:
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
3. Configure Pins (LED and push Button)
4. We can then use the LED and Button
Example: