rar

Basketball 24-second timer source program and circuit diagram for beginners 51 24-second timer made with delay

  • 2013-07-08
  • 96.83KB
  • Points it Requires : 2

#include

unsigned char code time[]={0x59,0x58,0x57,0x56,0x55,0x54,0x53,0x52,0x51,0x50,0x49,0x48,0x47,

0x46,0x45,0x44,0x43,0x42,0x41,0x39,0x38,0x37,0x36,0x35,0x34,0x33,0x32,0x31,0x30,0x29,0x28,0x27,0x26,0x25,0x24,0x23,0x22,0x21,0x20,0x19,0x18,0x17,0x16,0x15,0x14,0x13,0x12,0x11,0x10,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00};

unsigned char Second;

unsigned char timer;

unsigned char fen;

void delays()

{

unsigned char i,j,k;

for(k=100;k>0;k--)

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

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

}

void main()

{

TMOD=0X02;

EX0=1;

EA=1;

fen=47;

timer=0;

Second=34;

P2=time[Second];

P1=time[timer];

P0=time[fen];

while(1)

{

delays();

Second++;

timer++;

if(Second==59)

{

Second=34;

}

P2=time[Second];

if(timer==59)

{

++fen;

timer=0;

}

if(fen==59) fen=47;

P1=time[timer];

P0=time[fen];

}

}

void int0() interrupt 0 using 0

{

Second=34;

P2=time[Second];

}

unfold

You Might Like

Uploader
xieryou
 

Recommended ContentMore

Popular Components

Just Take a LookMore

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号
×