PIC single digital tube cyclically displays 0-9

Publisher:数字狂想Latest update time:2017-12-07 Source: eefocusKeywords:PIC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

8 digital tubes scroll to display the same number 

8 digital tubes display multiple different characters 

 8 digital tubes flash 

8 digital tubes scroll to display a string of numbers

#include


__CONFIG(0x3B31);
unsigned char tab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7C,0x39,0x5E,0x79,0x71}; //0-F--common cathode digital tube

#define  LED  PORTB
void delay1ms(unsigned int x)
{
 unsigned char i;
 for(;x>0;x--)
  for(i=0;i<165;i++); 
}
void init()
{
 TRISB=0x00;
 PORTB=0xFF; 
}
void main()
{
 unsigned char i;
 init();
 while(1)
 {
  for(i=0;i<10;i++)
  {
   LED=tab[i];
   delay1ms(500);  
  } 
 } 
}


Keywords:PIC Reference address:PIC single digital tube cyclically displays 0-9

Previous article:Key points and description of PIC24F EEPROM read and write interrupt event processing function
Next article:PIC16f877A read and write 24c02 program

Recommended ReadingLatest update time:2024-11-16 18:08

Section 3: Internal structure of PIC16C5X series microcontroller
The PIC16C5X integrates an 8-bit arithmetic logic unit (ALU) and working register (W) on one chip; 384 to 2K of 12-bit program memory (ROM); 32 to 80 8-bit data registers (RAM); 12 to 20 I/O ports; 8-bit counter and prescaler ; clock, reset, and watchdog counter, etc. The internal structure is shown in Figure 1.2:  
[Microcontroller]
Section 3: Internal structure of PIC16C5X series microcontroller
Features and Applications of PIC Microcontroller
1 Overview The PIC16C72 produced by Microchip is an 8-bit high-performance microcontroller based on EPROM. Compared with other microcontrollers of similar price, it has great improvements in execution speed and code compression. Since the required OPT (one-time programming) products can be purchased at any time, th
[Microcontroller]
PIC16F877 MCU Internal EEPROM Read and Write Example
;P IC 16F877  MCU  internal EEPROM reading and writing example**************************************************************************************** ; This is a program to test the function of reading&writting for EEPROM.  ; You  CAN   OBS erve the value of register(30H--?) buy changing "VALU" and "WRC_". ; Notice t
[Microcontroller]
Briefly describe what is PIC microcontroller
The PIC microcontroller is a small computer PIC microcontrollers have computing functions and memory like a CPU and are controlled by software. However, the processing power-memory capacity is very limited, depending on the type of PIC. But their highest operating frequency is about 20MHz, and the memory capacity is
[Microcontroller]
How to write PIC microcontroller configuration bits (MPLAB X Integrated Development Environment, XC Compiler)
I have recently come into contact with the MPLABX integrated development environment, X16 and X8 compilers, which are very different from the previous PIC development environment. Here I will talk about the first step of creating a new project, the writing of configuration bits. 1: The configuration bit writing exampl
[Microcontroller]
How to write PIC microcontroller configuration bits (MPLAB X Integrated Development Environment, XC Compiler)
PWM of CCP module of PIC
              Unlike the PWM implementation of 51MCU, PIC can set registers to control duty cycle, frequency, By setting the register, CCP1,
[Microcontroller]
PWM of CCP module of PIC
Programming LCD display based on PIC MG-12232 module (C program)
In the initialization part of the system program, the registers and temporary variables used in the program should be described, such as: unsigned char TRANS; unsigned char PAGEADD; //Store page address register unsigned char PAGENUM; //Store the total page number registerunsigned char CLMSUM; //Store the total column
[Microcontroller]
Design of wireless data transmission system based on nRF24L01 and PIC16F877
introduction In industrial control sites, it is often necessary to collect a large amount of field data, such as temperature, humidity, air pressure, etc., and transmit these data to the host for processing. The host transmits the control signal to the field execution module for various operations based on th
[Industrial Control]
Design of wireless data transmission system based on nRF24L01 and PIC16F877
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号