3.Key recognition
Since the key recognizes the low level of the corresponding scan, P07 is set to output a low level.
1 ) Complete the program flow modification as shown in Figure 16 and make corresponding configuration modifications.
Figure 16 Program flow
Figure 17 Modify configuration
2 ) Click “ Generate Project Source Code ” to generate the project code , and its main program is shown in Figure 18 .
Figure 18 Generated main program
3 ) After compiling and downloading the program, press the K1~K4 keys in sequence, and the output result is shown in Figure 19 .
Figure 19 Key value output
4.MP3 audio module control
The MP3 audio module is a functional module controlled by serial communication. It can achieve the purpose of selection and control by cooperating with buttons.
The main commands for controlling MP3 are: play command, stop command and volume adjustment command. For easy control, they can be placed in array variables.
1 ) Add an array variable to store instructions
2 ) Add playback processing function
3 ) Complete the program flow modification as shown in Figure 20 and reconfigure as shown in Figure 21 .
Figure 20 Program flow
Figure 21 Update related configuration
4 ) After compilation, the result is shown in Figure 22
Figure 22 Compilation results
5 ) After downloading the program, press K1 , K2 , and K3 keys in sequence to play, stop, and adjust the volume of the song respectively. The output content is shown in Figure 23 .
When the MP3 player module is connected , the control effect can be heard.
Figure 23 Operation effect
Previous article:51 MCU serial port receiving and sending string source program
Next article:Application of MAX7219 serial input and output common cathode display driver
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- National VI OBD emission terminal H6S remote online monitoring production test tool
- Design and Implementation of VGA Image Controller Based on CPLDFPGA
- [Live broadcast has ended] TI's new generation of high-performance, low-power Zigbee solutions
- Will you use ESP32-C2 to replace ESP8266?
- Another way to use MicroPython serial port receive interrupt
- Solution Download Littelfuse 2022 Latest Battery Solution Online Exhibition Hall
- User Guide:TI LAUNCHXL-F28027 C2000 Piccolo LaunchPad
- [Raspberry Pico Review] -- Just received the sample today
- The six lies of open source. Are they true?
- 【ST NUCLEO-H743ZI Review】Testing SPI+TFT (3)