Circuit diagram:
code show as below:
Reference address:Microcontroller LED digital tube
code show as below:
#include
char led_mod[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f }; //LED 0 - 9
void delay(unsigned int time) {
unsigned int j = 0;
for(; time > 0; time--)
for(j = 0; j < 125; j++);
}
void main(void) {
char i = 0, j =0;
P0 = P2 = led_mod[0];
while (1) {
for(i = 0; i <= 9; i++) {
P0 = led_mod[i];
//delay(500);
for(j = 0; j <=9; j++){
P2 = led_mod[j];
delay(800);
}
P2 = led_mod[0];
}
}
}
Previous article:Microcontroller LED light counting
Next article:Single chip cycle water lamp 2
Recommended ReadingLatest update time:2024-11-16 15:02
LED heat conduction and heat dissipation thermal path glue-free process
It is well known in the industry that LEDs are afraid of heat, because heat will affect the light decay and life of LEDs. Today, we will introduce a new assembly process for LED application products - a glue-free process for LED heat conduction and heat dissipation, and share it with readers! The current assembly
[Power Management]
Industry experts explain how to design protection for LED switching power supplies
LED switching power supply overcurrent protection circuit In the DC LED switching power supply circuit, in order to protect the adjustment tube from being burned when the circuit is short-circuited and the current increases. The basic method is that when the output current exceeds a certain value, the adjustment tub
[Power Management]
Combination of linear and switching LED power supply design
To control brightness, light emitting diodes ( LEDs ) require a constant current. This is achieved by connecting a resistor in series with a group of LEDs. Since both the voltage across a group of LEDs and the supply voltage may vary, a dedicated LED driver must be used to ensure accurate current. Two solutions are
[Power Management]
Comprehensive analysis of the LED dimming system circuit of STC89C52 microcontroller
Abstract: After the field effect transistor is turned off, the cathode voltage of the LED increases, causing the LED to turn off. When the field effect transistor is turned on, the cathode voltage of the LED is pulled low, causing the LED to emit light. The PWM adjustment method makes the drive circuit simpler and red
[Microcontroller]
Technical knowledge: LED with sensing function and can display the intensity of ambient light
In addition to their traditional roles as indicators and illumination, modern LEDs can also act as photovoltaic detectors . Simply connecting a red LED to a multimeter and shining a bright light source, such as a similar red LED, on it will produce a reading greater than 1.4V (Figure 1). A model of a reverse-biased L
[Power Management]
Overcome the five technical difficulties of LED lights, otherwise the MOS tube will keep burning
1. Chip heating This content is mainly for high-voltage driver chips with built-in power modulators. If the current consumed by the chip is 2mA, and a voltage of 300V is applied to the chip, the power consumption of the chip is 0.6W, which will of course cause the chip to heat up. The maximum current of the driv
[Power Management]
ON Semiconductor's Advanced Energy-Saving Automotive LED Lighting Solutions
Automotive LED lighting not only creates a stylish vehicle appearance and a personalized atmosphere, but also plays an important role in fuel economy and active safety. Advanced lighting solutions can automatically dim and turn according to the driver's operation, road conditions and environmental conditions, thereby
[Automotive Electronics]
PWM dimming technology: How to optimize LED color stability
This article discusses methods for providing light emitting diode (
LED
) dimming, analyzes the effects of LED dimming on its long-term performance and the color stability of the light emitted, and specifically discusses how to combine a linear constant current regulator (CCR) and a digital transistor to p
[Power Management]
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
Guess you like
- Which option is the best?
- MSP430F5529 generates PWM waves with CCS
- TI C66x DSP QM queue reserve method
- GD32E231Cx builds its own project OK, share it with everyone
- How to deal with audio noise
- Terasic C5P FPGA development board and Intel Up2 Squared Grove development kit released
- EEWORLD University - Introduction to Switching Power Supply Circuit Design
- 【ST NUCLEO-H743ZI Review】(3) First experience with UART3 testing
- DIY-Small Stool (First Work)
- Simple self-start