Microcontroller LED digital tube

Publisher:MysticGardenLatest update time:2016-04-19 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Circuit diagram:
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];
}
}
}

Reference address:Microcontroller LED digital tube

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]
LED heat conduction and heat dissipation thermal path glue-free process
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]
Industry experts explain how to design protection for LED switching power supplies
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]
Combination of linear and switching LED power supply design
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]
Comprehensive analysis of the LED dimming system circuit of STC89C52 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]
Technical knowledge: LED with sensing function and can display the intensity of ambient light
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]
ON Semiconductor's Advanced Energy-Saving Automotive LED Lighting Solutions
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]
PWM dimming technology: How to optimize LED color stability
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号