
#Gpio led 3 nucleo f401re free#
The companies which make these chips – ST Microelectronics in this case – usually also provide free header files which have definitions for which memory addresses go to which peripherals, and which bits do what. For example, in this tutorial we will set a bit to 1 in an “Output Data Register” to pull a pin’s voltage high enough to turn on an LED, and reset the same bit to 0 to pull the pin to ground and turn the LED off. The way that we read and program these peripherals is to check and set certain values at specific memory addresses. They can do things like speak common communication protocols with other chips, run actions on timers, and send general-purpose signals to the pins connected to the chip. It has a number of hardware “Peripherals” to make it easier for you write programs which interact with the real world. The STM32 chips have a lot of functionality which is not easy to represent in the standard C language. The resistor and capacitor are both optional – they’re just a very simple form of debouncing. You can find the actual pin mappings in section 6.11 of this reference document, or they’re also printed on the informational card that comes with the board.

Strangely, the B1 pin is labeled ‘D6’ on the Nucleo boards I think that ST wanted to use the same footprint and labeling as the popular Arduino Nano.

The 100nF capacitor across the button should help reduce noise, one side of the button connects to ground through a jumper wire, and I put a 470Ω resistor between the other side of the button and pin B1. The green ‘LD3’ LED is attached to pin B3 on the board. ‘Nucleo’ STM32F031K6 board with a button.
