C51 digital tube numeric tube

Publisher:WanderlustHeartLatest update time:2022-01-26 Source: eefocusKeywords:C51  tube Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

#include

#define uchar unsigned char

#define uint unsigned int


uint i,j;

sbit dula=P2^6;

sbit temperature=P2^7;

uchar table[]={0x3f,0x06,0x5b,

0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,

0x7c,0x39,0x5e,0x79,0x71};


void delay(uint);

void main()

{

while(1)

{

P0=0xea;

temperature=1;

temperature=0;

P0=table[0];

game=1;

game=0;

    delay(1000);

P0=table[1];

game=1;

game=0;

delay(1000);

}

}



void delay(uint x)

{

for(i=x;i>0;i--)

{

for(j=120;j>0;j--);

}

}


Common cathode digital tube segment selection code table (common anode digital tube segment selection code inversion)

image.png


Keywords:C51  tube Reference address:C51 digital tube numeric tube

Previous article:C51 timer and counter timer and counter
Next article:C51 running water lamp

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

C51 programming experience summary sharing
  In the development and application of microcontrollers, high-level languages ​​have gradually begun to be introduced, and C language is one of them. People who are used to assembly always feel that high-level languages ​​are not as "controllable" as they can be as arbitrary as assembly. The following are some of the
[Microcontroller]
N76E003 Project Creation Tutorial
1. Preparation: 1. Download the compilation tool keil c51 2. Download the board support package (BSP) provided by N76E003, which can be downloaded from nuvoton 2. Development Environment Construction 1. Install keil c51, then harmony... You can't just post links, so you need to find the software online, there are a
[Microcontroller]
N76E003 Project Creation Tutorial
C51 writes serial communication, simulation and debugging in proteus————The ultimate nanny-level teaching
Two communication methods Serial Communication: Serial communication is the process of dividing data bytes into bits. Parallel communication: Parallel communication usually involves transmitting each bit of a data byte simultaneously using multiple data lines. Serial communication is divided into two types Synchrono
[Microcontroller]
C51 writes serial communication, simulation and debugging in proteus————The ultimate nanny-level teaching
Several useful modules for C51 programming - keyboard scanning module
The keyboard scanning module has two working modes, one is automatically called by the clock module, and the other is called by the programmer. 1) Automatically called by the clock module Include the clock module implementation file (Timer.h) and the keyboard scanning module implementation file (KBScan.c) into the
[Microcontroller]
"Beginner's C51 Self-study Notes" - Four working modes of timer (Part 2)
1. Method 0: Mode 0 is a 13-bit count, consisting of the lower 5 bits of TL0 (the upper 3 bits are unused) and the 8 bits of TH0. When the lower 5 bits of TL0 overflow, they carry to TH0. When TH0 overflows, the TF0 flag in TCON is set and an interrupt request is sent to the CPU.   There are 13 bits in total. The 3
[Microcontroller]
Xiaobai self-study c51 notes - running water lamp
Development board schematic diagram: From the schematic diagram of the development board, we know that LEDs 1 to 8 are connected to P2^0 to P2^7 respectively. When low voltage is input to P2 port, the LED lights up (VCC indicates high voltage, and P2 outputs low voltage when it is 0 and high voltage when it is 1). I
[Microcontroller]
Xiaobai self-study c51 notes - running water lamp
Let SlickEdit automatically compile Keil C51 projects
The previous article has talked about how to manually call Keil's C51 compiler to compile our project. Today I will tell you how to configure the compilation command in the SlickEdit environment. First create a new SlickEdit project Assuming the project path is "D:51", select the second option in th
[Microcontroller]
Let SlickEdit automatically compile Keil C51 projects
【C51】Introduction to MCU Timer
The standard 51 architecture microcontroller has two timers: T0 and T1. Their usage is almost the same. The following mainly describes the usage of T0 timer. Initial understanding The timer and counter are the same module in the microcontroller. Their essence is: addition storage counter. The counter is easy to un
[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号