Here we first need to explain the 138 decoder, which is a chip that I call 3 inputs and 8 outputs.
ABC is the input terminal, so when AB
#include
typedef unsigned int u16;
typedef unsigned char u8;
sbit LSA = P2^0;
sbit LSB = P2^1;
sbit LSC = P2^2; //bit definition
u8 code smgduan [] = {0x3f, 0x06, 0x5b,0x4f, 0x66, 0x6d, 0x7d, 0x07,
0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71}; //0-9 hexadecimal representation
void main()
{
LSA = 0;
LSB = 0;
LSC = 0; //A, B, C output low level, LED1 output low level
P0 = smgduan[0];
When C inputs 0 (low level), Y0 outputs low level, so the first light on the digital tube will be lit.
At this time, the hexadecimal representation of the control digital tube segment is represented by an array. For example, 0x3f represents "0", so after the program design is completed, the first light on the digital tube will display 0.
Previous article:573 latch drives 8-segment digital tube
Next article:Timer counting experiment
- 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
- 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
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Showing goods + Embedded Primary Development Board (MOOC) video
- Altium Designer v20.1.12.249
- Thank you for being my first leader in the workplace
- MicroPython now supports STM32L452
- MOS tube control shutdown problem
- MicroPython Hands-on (06) - Learn MaixPy monocular camera from scratch
- Goodbye 2019, Hello 2020 + Review of my 2019
- MSP430 non-continuous IO parallel port output matrix keyboard
- Zero environment setup, the simplest QT interface programming Helloworld runs in the embedded Linux touch industrial tablet
- Share: STM32 controls HC-05 Bluetooth module for communication