573 latches drive 8-segment digital Tubes

Source: Internet
Author: User

573 latches drive 8-segment digital Tubes

# Include <reg51.h> # define SEG P2 sbit P1_0 = P1 ^ 0; sbit P1_1 = P1 ^ 1; sbit P1_2 = P1 ^ 2; sbit P1_3 = P1 ^ 3; sbit P1_4 = P1 ^ 4; unsigned char code tab [] = {0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x3c, 0x07, 0x7f, 0x37}; // total cathode void delay (int x); void main () {while (1) // 2015 {P1_0 = 0; // 573 low-level enabling SEG = tab [2]; // send the segment P1_1 = 0; // light up the digital tube P1_0 = 1; // close the lock P1_1 = 1; // disable the digital tube P1_0 = 0; // 573 enable SEG = tab [0]; P1_2 = 0; P1_0 = 1; P1_2 = 1; P1_0 = 0; // 573 low-level enabling SEG = tab [1]; P1_3 = 0; P1_0 = 1; P1_3 = 1; P1_0 = 0; // 573 low-level enabling SEG = tab [5]; P1_4 = 0; P1_0 = 1; P1_4 = 1 ;}} void delay (int x) // 6 ms * x 23 MHz crystal oscillator {int I, j; for (I = 0; I <x; I ++) for (j = 0; j <12000; j ++ );}
# Include <reg51.h> # define SEG P2 sbit P1_0 = P1 ^ 0; sbit P1_1 = P1 ^ 1; sbit P1_2 = P1 ^ 2; sbit P1_3 = P1 ^ 3; sbit P1_4 = P1 ^ 4; unsigned char code tab [] = {0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x3c, 0x07, 0x7f, 0x37}; void delay (int x); void main () {while (1) // 521 1314 {P1_0 = 0; // 573 low-level enabling SEG = tab [5]; // send the segment P1_1 = 0; // light up the digital tube delay (166); // delay P1_0 = 1; // disable the lock storage P1_1 = 1; // disable the digital tube P1_0 = 0; // 573 enable SEG = tab [2]; P1_2 = 0; delay (166 ); p1_0 = 1; P1_2 = 1; P1_0 = 0; // 573 low-level enabling SEG = tab [1]; P1_3 = 0; delay (166); P1_0 = 1; p1_3 = 1; //////////////////////////////////////// /// 1314 P1_0 = 0; // 573 low-level enabling SEG = tab [1]; // send the segment P1_1 = 0; // light up the digital tube delay (166); // delay P1_0 = 1; // disable the lock storage P1_1 = 1; // disable the digital tube P1_0 = 0; // 573 enable SEG = tab [3]; P1_2 = 0; delay (166 ); p1_0 = 1; P1_2 = 1; P1_0 = 0; // 573 low-level enabling SEG = tab [1]; P1_3 = 0; delay (166); P1_0 = 1; p1_3 = 1; P1_0 = 0; // 573 low-level enabling SEG = tab [4]; P1_4 = 0; delay (166); P1_0 = 1; p1_4 = 1 ;}} void delay (int x) // 6 ms * x 23 MHz crystal oscillator {int I, j; for (I = 0; I <x; I ++) for (j = 0; j <12000; j ++ );}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.