-
You use a P1 port to control the dynamic scanning of 8 digital tubes, and the dynamic scanning display of digital tubes needs to be blanked.
wei=1;
p0=table_wei[2];
wei=0;
duan=1;
p0=table_duan[i];
duan=0;
delay(200);
Changed to: wei=1;
p0=table_wei[2];
wei=0;
duan=1;
p0=table_duan[i];
duan=0;
p0=0x00;
delay(200);
-
I'm a total of four people, and the procedure is like this, it seems to be good.
#include
typedef unsigned char uint8;
typedef unsigned int uint16;
uint8 number=;
main()
uint8 i=0,j=0,k=0,l=0;
uint16 counter,n;
tmod = 0x01;
th0 = 0xb7;
tl0 = 0xff;
tr0 = 1;
while(1)
n=(l*1000+k*100+j*10+i);
if(1 == tf0)
tf0 = 0;
th0 = 0xb7;
tl0 = 0xff;
counter++;
p1=~number[i];p3=0xef;p3=0xff;
if(n>9)
p1=~number[j];p3=0xdf;}p3=0xff;
if(n>99)
p1=~number[k];p3=0xbf;}p3=0xff;
if(n>999)
p1=~number[l];p3=0x7f;}p3=0xff;
if(50 == counter)
counter = 0;
i++;if(i == 10)
i = 0;
j++;if(j== 10)
j= 0;k++;
if(k== 10)
k= 0;l++;
if(l==10)
l= 0;
-
Very vegetable, I don't know, hehe.
-
What is the entry procedure of the MCU C program? Hello dear! The entry function of the C++ program is the main() function, and the main() function with the return value in the general VC is the int main() function.
If you are programming in MFC, you will find that there is no main() function, in fact, the MFC framework hides it, and the entry point of the program is still the main() function. That being said, these entrances are only **-level entrances. After the actual compilation, the compiler will add the startup ** of the run-time library, which is the real entry point for program execution.
After the startup is executed, the program calls the main function of the user to execute. startup ** usually gets the command line, gets the process handle, and so on. Prepare the main function.
And different compilers, different platforms, startups** are different. Hope it helps!
void key0()
if(p1_0!=1) *If the key 0 is pressed. >>>More
Isn't this thing just a digital tube displaying 16 digits? Prompt you 16 times to get there, let go after you think to press the stop button. If so, the procedure is available for reference: >>>More
The introductory course of MCU C language programming is not difficult, it is not easy to say, and the first thing to understand is to understand what these two things are when learning MCU C language? The introductory programming of single-chip microcomputer is mainly to learn C language, followed by circuit and programming language. >>>More
To put it simply, it can be like this:
setb k1 ;K1 always works. >>>More
A: The bit-addressing area is located between 20F and 2Fh in the data memory. The registers in this interval can be bit-addressed, and they can be bit-manipulated and bit-arithmetic. >>>More