Traditional Culture Encyclopedia - Photography and portraiture - Write a program in C language and display 1-8 on eight digital tubes in turn.
Write a program in C language and display 1-8 on eight digital tubes in turn.
My program is based on PROTUES simulation. You can draw your own circuit diagram according to the program, which is very simple and used here.
Two 74HC573 chips display 0-f.
# include & ltreg 5 1 . h & gt;
# include & ltintrins.h & gt
# Define uchar unsigned characters
# Define uint unsigned integer
sbit duan=p 1^6;
sbit wei=p 1^7;
uchar temp = 0x 0 1;
Uchar code tab[]={ 0xc0, 0xf9, 0xA4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x90, 0x88, 0x83, 0xc6, 0xa 1, 0x86, 0x8e };;
uchar a = 0;
Invalid delay (uint z);
void main()
{ while( 1)
{Wei =1; P2 = temperature; Wei = 0;
Segment =1; P2 = tab[a]; Segment = 0;
Delay (300);
temp=_crol_(temp, 1);
a++;
if(a = = 16){ a = 0; }} }
Invalid delay (unit z)
{ uint x,y;
for(x = z; x & gt0; x -)
for(y = 120; y & gt0; y-); }
- Previous article:Summary of epidemic prevention and control in 2022 [5 articles]
- Next article:Help them take a perfect wedding photo introduction
- Related articles
- How to report overseas gamblers quickly?
- How about Chengde Jiuniu Trading Co., Ltd.
- What are the good places to take wedding photos in Guangdong?
- What are the functions of mobile phone taking pictures in summer?
- Who are the best Feng Shui masters in China?
- Foshan sanitary bathroom photography
- In the original text of "Brothers for Class 61"
- Setting method of mobile phone time-delay photographing
- Chen Guo photographer
- What is Heilongjiang Friendship Farm?