Implement a common anode digital tube in C Language

Source: Internet
Author: User
#include <reg52.h>void main(){P1=0xB0;while(1);}

Well, that's the code. The actual circuit may have 74h or something. However, it is only one person who wants to record his doubts about why it is B0 rather than 0b.

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

Digital tube principle

A B C D E F G DP in alphabetical order

Corresponding Level 0 0 0 0 1 1 0 1

However, the digital assistant is 1 0 1 0 0 0 0. I thought I was wrong about the level. After all, I had no foundation at all, and everything started from scratch.

Later I learned:Data indicates that it starts from a high position.

While a B c d E F G DP is connected to p0.0 p0.1 g02 g03 g04 g05 g06 g07 pins respectively. Starting from a high position, it should be

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

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.