First, STM32F103C8 pin distribution
Second, the LED common Yin, common yang connection method
This should be the connection of the seven-segment digital tube.
The current limiting resistor is selected as 470, and the multism is also required to be plugged in, otherwise flashing occurs. or change the properties directly.
Third, remove the mechanical vibration of the button 1, the characteristics of the key
The keyboard is composed of several independent keys, the press and release of the key is achieved by mechanical contact closure and disconnection, because the mechanical contact elastic action, in the moment of closure and disconnection has a jitter process. 2, to shake the method
(1) Hardware de-jitter, mainly through the filter circuit.
(2) Software jitter, delay function.
Four, Button control lights 1, one-to-one
The circuit of each key is independent and occupies a data line. This keyboard occupies a lot of hardware resources, suitable for a small number of keys.
2. When the matrix (utilization rate increases by one times)
Let the d0,d1,d2,d3 output be 0,
When detecting a d4-d7 that has a 0, and then detects that D0-d3 has a 0, determine which switch in the matrix can be used.
Electric Racing Rookie Camp Training (a)--stm32 led control