Implementing a common anode digital tube in C language

Publisher:hzx312895379Latest update time:2018-05-07 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

#include  

void main()  

{  

    P1=0xB0;  

    while(1);  

}  

Well, that's all the codes. The actual circuit may have 74H or something. But it's just one bit, mainly to record my confusion about why it is B0 instead of 0B.

Assume that the digital tube is a common anode digital tube and the number "3" is to be displayed.

The principle of digital tube is as shown in the figure:

In alphabetical order: a b c d e f g dp

Corresponding level high and low 0 0 0 0 1 1 0 1

But when I used the digital tube assistant, it was 1 0 1 1 0 0 0 0. I thought I had misjudged the electrical level, after all, I had no basic knowledge at all and had to start from scratch.

Later I found out that data is represented starting from the high bit.

And a b c d e f g dp are connected to P0.0 P0.1 P0.2 P0.3 P0.4 P0.5 P0.6 P0.7 pins respectively. Starting from the high position, it should be

1 0 1 1 0 0 0 0 instead of 0 0 0 0 1 1 0 1. This is exactly the same as the result obtained by the digital tube assistant.


Reference address:Implementing a common anode digital tube in C language

Previous article:C language to realize the operation of common cathode digital tube
Next article:Very amazing microcontroller program

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号