欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開(kāi)始

搜索
查看: 1620|回復(fù): 0
收起左側(cè)

單片機(jī)基礎(chǔ)1-9999計(jì)數(shù)器

[復(fù)制鏈接]
ID:1103892 發(fā)表于 2023-12-12 15:05 | 顯示全部樓層 |閱讀模式
1-9999.png
  1. #include<reg51.h>
  2. unsigned char code table1[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67};
  3. unsigned char code table2[]={0xf7,0xfb,0xfd,0xfe};
  4. unsigned char i,num;
  5. unsigned int count;
  6. void delay(int);
  7. main()
  8. {
  9.   while(1)
  10.   {       
  11.         {if(count==9999)count=0;}
  12.         count++;
  13.         for(num=0;num<200;num++)
  14.         {P0=0x00;
  15.          P2=table2[0];
  16.          P0=table1[((count%1000)%100)%10];
  17.          delay(1);

  18.          P0=0x00;
  19.          P2=table2[1];
  20.          P0=table1[((count%1000)%100)/10];
  21.          delay(1);

  22.          P0=0x00;
  23.          P2=table2[2];         
  24.          P0=table1[(count%1000)/100];
  25.          delay(1);

  26.          P0=0x00;
  27.          P2=table2[3];
  28.          P0=table1[count/1000];
  29.          delay(1);
  30.          }       
  31.   }       
  32. }
  33. void delay(int x)
  34. {
  35.   int i,j;
  36.   for(i=0;i<x;i++)
  37.      for(j=1;j<=150;j++);
  38. }
復(fù)制代碼

1-9999計(jì)數(shù)器.zip (66.42 KB, 下載次數(shù): 19)

評(píng)分

參與人數(shù) 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎(jiǎng)勵(lì)!

查看全部評(píng)分

回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表