Single chip digital cycle display C program

Publisher:范隆Latest update time:2016-01-21 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

       #include
       sbit p10=P1^0;
       main()
       {unsigned char s[]={0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
       unsigned char k,i=1;
       unsigned char j;
       unsigned char g=0x7f;
       void delay();
       unsigned char a,b,c;
       while(1)
       {for(i=0;i<8;i++)
       j=i;
      for(c=250;c>0;c--)
      { P3=g;
     
       P0=s[j];
    delay();
       if(j==0) {j=i;g=0x7f;k=0;continue;}
       j--;
      
       g=(g>>1)+0x80;
       k++;
     
      } }
       }
       }
       void delay()
       {unsigned char a,b;
       for(a=10;a>0;a--)
       for(b=200;b>0;b--);}


Keywords:MCU Reference address:Single chip digital cycle display C program

Previous article:51 single chip microcomputer uses C language to realize accurate delay program
Next article:MX7219 control LED display C program

Recommended ReadingLatest update time:2024-11-16 22:35

Electronic clock with temperature display based on single chip microcomputer
The microcontroller source program is as follows: /* *************************************************************************************** * "Teach you how to learn 51 single chip microcomputer step by step (C language version)" * KST-51 MCU development board sample source code * * File name: main.c * Description:
[Microcontroller]
Electronic clock with temperature display based on single chip microcomputer
Cortex-M MCU based on SPIFI peripheral completely solves the problem of embedded flash memory selection
Introduction: The SPI Flash Interface (SPIFI) technology, first used in the new NXP ARM Cortex-M3 microcontroller, can help 32-bit embedded system designers replace large, expensive parallel Flash with small, low-cost serial Flash. Using SPIFI (pronounced as spiffy, meaning "excellent, neat, beautiful", etc. - translat
[Microcontroller]
Cortex-M MCU based on SPIFI peripheral completely solves the problem of embedded flash memory selection
Experiment 12: MCU singing --- "Wish you peace"
The following are his asm source program and hex program (the asm program can be edited with uvw51e on the matching CD to get hex. Of course, the following hex can also be copied directly to Notepad and saved as txt, and burned directly into the chip. Note that the XP kit supports text burning. The Yitian version k
[Microcontroller]
Design of sound and light control switch based on AT89S52 single chip microcomputer
With the development of electronic technology, especially the development of digital technology, it is becoming more and more important to use digital circuit technology to realize the automatic lighting of lights, energy saving and power saving, and extend the life of lights, and it is close to real life. The sound a
[Power Management]
Design of sound and light control switch based on AT89S52 single chip microcomputer
MCU "Programming Language" Specification
  I have found in many years of teaching that the most difficult part of learning single-chip microcomputers is programming. Looking through the current single-chip microcomputer textbooks, the hardware part and the knowledge explanation part are basically the same, only the programming part is really varied and color
[Microcontroller]
MCU
SAM4E MCU Tour - 12. USART
Now that we know how to use UART, let's study how to use USART. Similar to the last time, this time we also use the USART serial port to communicate with the PC. The difference from the last time is that USART itself has a receive timeout function, so TC is not needed this time. Compared with UART, USART has many more
[Microcontroller]
SAM4E MCU Tour - 12. USART
51 MCU learning notes: using ADC0804 analog-to-digital converter to collect voltage
The potentiometer adjusts the voltage value to be detected and displays it on the digital tube. Most of the codes are copied from the book. Example 5.3.1 in the book requires the first three digital tubes to display the 8-bit digital value after AD conversion (i.e. 0~255) Here I let the first 4 digital tubes display s
[Microcontroller]
51 MCU learning notes: using ADC0804 analog-to-digital converter to collect voltage
ADC Button Design Techniques Based on AVR Microcontroller
1 Introduction In the field of single-chip microcomputer applications, the ways and methods of human-computer interaction are flexible and diverse, but keyboard input is still the most common and important method. The usual ways to implement keyboard interface are: direct input, matrix structure, A/D mode, keyb
[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号