Single chip dot matrix LED light

Publisher:爱笑的猫咪Latest update time:2016-04-19 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The circuit diagram is as follows:
Single chip dot matrix LED light
code show as below:
#include
 
unsigned char code tab[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
//unsigned char code tab[]={0x7f,0xbf,0xdf,0xef,0xfe,0xfd,0xfb,0xf7};
unsigned char code graph[3][8]={ {0x21,0x32,0xac,0x6c,0x32,0x21,0x3a,0x7f},
{0x00,0x02,0x04,0x0a,0xff,0x08,0x04,0x02},
{0xe1,0x55,0x55,0xdf,0x55,0x55,0x43,0x71}
};
unsigned char count;
unsigned char cnta;
sbit P1_0 = P1^0;
 
void main(void) {
 
unsigned char i,j;
 
TMOD=0x01;
TH0=(65536-4000)/256;
TL0=(65536-4000)%6;
TR0=1;
ET0=1;
EA=1;
 
while(1) {
if(P1_0==0) {
for(i=5;i>0;i--)
for(j=248;j>0;j--);
if(P1_0==0) {
count++;
if(count==3) {
count=0;
}
while(P1_0==0);
}
}
}
}
 
void t0(void) interrupt 1 using 0 {
TH0=(65536-4000)/256;
TL0=(65536-4000)%6;
P2=tab[cnta];
P3=graph[count][cnta];
cnta++;
if(cnta==8) {
 cnta=0;
}
}

Keywords:MCU Reference address:Single chip dot matrix LED light

Previous article:MCU interrupt experiment 1
Next article:Single chip LCD display

Recommended ReadingLatest update time:2024-11-16 21:23

DC motor speed regulation experiment based on 51 single chip microcomputer
1. Experimental Principle PWM: Pulse Width Modulation. In an inertial system, the required analog quantity can be equivalently obtained by modulating the width of a series of pulses. It is often used for motor speed regulation, light brightness adjustment, etc. This experiment is essentially the same
[Microcontroller]
DC motor speed regulation experiment based on 51 single chip microcomputer
51 single chip GPIO structure block diagram and working principle
Preface No matter what microcontroller you study, the simplest peripheral is the high and low level control of the IO port. This tutorial will introduce to you how to output high and low levels by operating the GPIO port of the 51 microcontroller on the created project template. 1. GPIO concept GPIO (general purpose
[Microcontroller]
51 single chip GPIO structure block diagram and working principle
Matrix keyboard scanning, the microcontroller scans whether the key is pressed
In a single-chip microcomputer system, if there are many keys, such as electronic password locks and telephone keypads, there are generally at least 12 to 16 keys, and a matrix keyboard is usually used. A matrix keyboard is also called a row-column keyboard. It is a keyboard composed of four I/O lines as row lines and
[Microcontroller]
Matrix keyboard scanning, the microcontroller scans whether the key is pressed
Intelligent Control System of Washing Machine Based on AT89C52 Single Chip Microcomputer
  High-efficiency, energy-saving, water-saving, electricity-saving and environmentally friendly washing machines have always occupied a dominant position in the market. Whether in terms of quality, technology, function or appearance, they are closest to the purpose of serving people's lives. In the future, washing mac
[Microcontroller]
Intelligent Control System of Washing Machine Based on AT89C52 Single Chip Microcomputer
Design of Audio Signal Analyzer Based on Single Chip Microcomputer
0 Introduction At present, most audio signal processors are not only large in size but also expensive, and are difficult to be popularized in some special aspects. Embedded system analyzers are small and reliable, so the development of audio analysis instruments based on special function microcontrollers is
[Microcontroller]
8-bit MCU with 6-channel PWM port for LED lighting
LAPIS Semiconductor announced on September 17, 2013 that it has developed the 8-bit microcontroller (MCU) "ML610Q111/ML610Q112" for LED lighting control. According to reports, the new product is equipped with a 6-channel PWM (pulse width modulation) port, which can achieve a variety of tones and brightness, and can
[Power Management]
MCU data/idata/xdata/pdata/bit/code
DATA: Fixedly refers to the first 128 RAM from 0x00 to 0x7f, which can be directly read and written using acc, with the fastest speed and the smallest generated code. DATA is a data memory address between 0 and 127, or a special function register (SFR) address in the range of 128 .. 255. The two are accessed in diff
[Microcontroller]
Example of calculating the initial value of a microcontroller timer
Example of calculating the initial value of a timer   1. Calculation of the initial value of the 10MS timer: 1. Crystal oscillator 12M 12MHz divided by 12 is 1MHz, which means one second = 1000000 machine cycles. 10ms = 10000 machine cycles. 65536-10000=55536(d8f0) TH0=0xd8, TL0=0xf0 2. Crystal oscill
[Microcontroller]
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号