Talking about static digital tube

Publisher:量子心跳Latest update time:2016-12-16 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Here we first need to explain the 138 decoder, which is a chip that I call 3 inputs and 8 outputs.

 

ABC is the input terminal, so when AB


#include

typedef unsigned int u16;

typedef unsigned char u8;


sbit LSA = P2^0;

sbit LSB = P2^1;

sbit LSC = P2^2; //bit definition


u8 code smgduan [] = {0x3f, 0x06, 0x5b,0x4f, 0x66, 0x6d, 0x7d, 0x07,

                                 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71}; //0-9 hexadecimal representation


void main()

{

   LSA = 0;

   LSB = 0;

   LSC = 0; //A, B, C output low level, LED1 output low level

   P0 = smgduan[0];


When C inputs 0 (low level), Y0 outputs low level, so the first light on the digital tube will be lit.

At this time, the hexadecimal representation of the control digital tube segment is represented by an array. For example, 0x3f represents "0", so after the program design is completed, the first light on the digital tube will display 0.


Reference address:Talking about static digital tube

Previous article:573 latch drives 8-segment digital tube
Next article:Timer counting experiment

Popular Resources
Popular amplifiers
Latest Microcontroller Articles
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号