Re-picking the second day of the use of digital tube (dynamic scanning digital tube)

Source: Internet
Author: User

What is the function we want to achieve?

From the first digital tube scanning 1 to the second digital Tube 2, a third digital tube 3, .... Until the 8th Digital tube Display 8

1         /*--------------www.szjcdz.cn--------------------2 Name: Digital Tube Dynamic Scan3 written by: Shenhui4 Date: 2015.10.285 content: Digital tube Dynamic Scanning6 ------------------------------------------------*/7#include <reg52.h>8 #defineUchar8 unsigned char9 #defineuint16 unsigned intTenSbit latch1=p2^6; OneSbit latch2=p2^7; A voiddisplay (); -  -UCHAR8 Code duanma[]={0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80};//Show segment code value 0~F theUCHAR8 Code weima[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//corresponding to the corresponding digital tube lit, the accession code -  -Uchar8 Template;//Global variables that store display values -  + //Delay Function - voiddelayms (uint16 val) + { A uint16 i,j; at         for(i=0; i<val;i++) -             for(j=0;j<113; j + +); -  - }     -  -  in //******************************* main function *******************************// - voidMainvoid) to { +   Panax Notoginseng         -  the display (); +  A  the      +  - } $  $  -  - voidDisplayvoid ) the { - uint16 i;Wuyi      while(1) the     { -     Wu       for(i=0;i<8; i++) -      { Aboutp0=0; $latch1=1; -latch1=0; -          -  Ap0=weima[7-i]; +Latch2=1; theLatch2=0; -  $          thep0=Duanma[i]; thelatch1=1; thelatch1=0; the  -Delayms ( $); in      the       }        the        About      }   the  the  the}

Re-picking the second day of the use of digital tube (dynamic scanning digital tube)

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.