8 digital tubes scroll to display 1~8

Publisher:BlissfulSpiritLatest update time:2022-01-13 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

insert image description here

Program function, display eight numbers 0, 1, 2, 3, 4, 5, 6, 7 from left to right


The program source code is as follows:


/*

8 digital tubes display different characters at the same time

*/

#include

typedef unsigned char uint8;

typedef unsigned int uint16;


code uint8 LED_CODE[] = {0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8};


void delay(uint16 x)

{

uint16 i,j;

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

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

}


void main()

{

uint8 i;

while(1)

{

for(i = 0; i < 8; i ++)

{

P0 = 0xFF;

P3 = 0x01 << i;

P0 = LED_CODE[i];

delay(4);

}

}

}


Reference address:8 digital tubes scroll to display 1~8

Previous article:A single digital tube displays 0~F in a cycle
Next article:A single button controls a single digital tube to scroll display

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号